summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-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/check-testcase.test38
-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/include/wait_condition.inc.moved59
-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.pl32
-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.result6
-rw-r--r--mysql-test/r/csv_alter_table.result40
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result6
-rw-r--r--mysql-test/r/ctype_filesystem.result11
-rw-r--r--mysql-test/r/ctype_ucs.result11
-rw-r--r--mysql-test/r/ctype_utf8.result32
-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/events_scheduling.result9
-rw-r--r--mysql-test/r/events_time_zone.result11
-rw-r--r--mysql-test/r/explain.result75
-rw-r--r--mysql-test/r/federated.result61
-rw-r--r--mysql-test/r/federated_bug_25714.result7
-rw-r--r--mysql-test/r/fulltext.result28
-rw-r--r--mysql-test/r/func_compress.result2
-rw-r--r--mysql-test/r/func_group.result60
-rw-r--r--mysql-test/r/func_sapdb.result12
-rw-r--r--mysql-test/r/group_by.result30
-rw-r--r--mysql-test/r/group_concat_max_len_func.result74
-rw-r--r--mysql-test/r/index_merge_myisam.result10
-rw-r--r--mysql-test/r/information_schema.result85
-rw-r--r--mysql-test/r/information_schema_db.result21
-rw-r--r--mysql-test/r/information_schema_part.result15
-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.result16
-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_output_func.result38
-rw-r--r--mysql-test/r/log_state.result28
-rw-r--r--mysql-test/r/log_tables.result59
-rw-r--r--mysql-test/r/max_allowed_packet_basic.result53
-rw-r--r--mysql-test/r/max_allowed_packet_func.result19
-rw-r--r--mysql-test/r/merge.result21
-rw-r--r--mysql-test/r/metadata.result17
-rw-r--r--mysql-test/r/multi_update.result23
-rw-r--r--mysql-test/r/multi_update2.result25
-rw-r--r--mysql-test/r/mysqlcheck.result13
-rw-r--r--mysql-test/r/mysqldump-max.result13
-rw-r--r--mysql-test/r/mysqldump.result30
-rw-r--r--mysql-test/r/net_buffer_length_basic.result72
-rw-r--r--mysql-test/r/openssl_1.result17
-rw-r--r--mysql-test/r/order_by.result16
-rw-r--r--mysql-test/r/packet.result12
-rw-r--r--mysql-test/r/partition.result331
-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.result94
-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/perror-win.result6
-rw-r--r--mysql-test/r/ps_11bugs.result28
-rw-r--r--mysql-test/r/show_check.result34
-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/subselect.result30
-rw-r--r--mysql-test/r/subselect3.result16
-rw-r--r--mysql-test/r/symlink.result18
-rw-r--r--mysql-test/r/thread_cache_size_func.result42
-rw-r--r--mysql-test/r/timestamp_func.result44
-rw-r--r--mysql-test/r/timestamp_sysdate_is_now_func.result25
-rw-r--r--mysql-test/r/timezone2.result2
-rw-r--r--mysql-test/r/timezone3.result8
-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/type_newdecimal.result15
-rw-r--r--mysql-test/r/union.result8
-rw-r--r--mysql-test/r/update.result11
-rw-r--r--mysql-test/r/user_var.result33
-rw-r--r--mysql-test/r/variables-notembedded.result92
-rw-r--r--mysql-test/r/variables.result375
-rw-r--r--mysql-test/r/view.result35
-rw-r--r--mysql-test/r/wait_timeout_func.result58
-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/std_data/Moscow_leapbin991 -> 2674 bytes
-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/datadict/is_tables.inc1
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc.result23607
-rw-r--r--mysql-test/suite/funcs_1/r/is_character_sets.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_collations.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result76
-rw-r--r--mysql-test/suite/funcs_1/r/is_events.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result7
-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_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/ndb_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/triggers/triggers_03e_db_level.inc2
-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_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_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_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_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_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_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/r/rpl_truncate_7ndb_2.result91
-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/r/rpl_truncate_7ndb_2.result91
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt (renamed from mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test (renamed from mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test)7
-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_filesystem-master.opt2
-rw-r--r--mysql-test/t/ctype_filesystem.test6
-rw-r--r--mysql-test/t/ctype_ucs.test11
-rw-r--r--mysql-test/t/ctype_utf8.test17
-rw-r--r--mysql-test/t/disabled.def4
-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/events_scheduling.test33
-rw-r--r--mysql-test/t/events_time_zone.test83
-rw-r--r--mysql-test/t/explain.test47
-rw-r--r--mysql-test/t/federated.test83
-rw-r--r--mysql-test/t/federated_bug_25714.test12
-rw-r--r--mysql-test/t/federated_innodb.test7
-rw-r--r--mysql-test/t/fulltext.test27
-rw-r--r--mysql-test/t/func_compress.test5
-rw-r--r--mysql-test/t/func_group.test69
-rw-r--r--mysql-test/t/func_sapdb.test17
-rw-r--r--mysql-test/t/group_by.test29
-rw-r--r--mysql-test/t/group_concat_max_len_func.test83
-rw-r--r--mysql-test/t/information_schema.test45
-rw-r--r--mysql-test/t/information_schema_db.test30
-rw-r--r--mysql-test/t/information_schema_part.test10
-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_bug34300.test4
-rw-r--r--mysql-test/t/innodb_mysql.test24
-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_output_func.test75
-rw-r--r--mysql-test/t/log_state.test26
-rw-r--r--mysql-test/t/log_tables.test87
-rw-r--r--mysql-test/t/max_allowed_packet_basic.test27
-rw-r--r--mysql-test/t/max_allowed_packet_func.test19
-rw-r--r--mysql-test/t/merge.test25
-rw-r--r--mysql-test/t/metadata.test17
-rw-r--r--mysql-test/t/multi_update.test57
-rw-r--r--mysql-test/t/multi_update2-master.opt1
-rw-r--r--mysql-test/t/multi_update2.test43
-rw-r--r--mysql-test/t/mysqlcheck.test27
-rw-r--r--mysql-test/t/mysqldump-max.test1058
-rw-r--r--mysql-test/t/mysqldump.test13
-rw-r--r--mysql-test/t/net_buffer_length_basic.test49
-rw-r--r--mysql-test/t/openssl_1.test43
-rw-r--r--mysql-test/t/order_by.test20
-rw-r--r--mysql-test/t/outfile.test12
-rw-r--r--mysql-test/t/packet.test24
-rw-r--r--mysql-test/t/partition.test125
-rw-r--r--mysql-test/t/partition_innodb.test84
-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/perror-win.test14
-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/subselect.test36
-rw-r--r--mysql-test/t/subselect3.test22
-rw-r--r--mysql-test/t/symlink.test35
-rw-r--r--mysql-test/t/thread_cache_size_func.test148
-rw-r--r--mysql-test/t/timestamp_func.test69
-rw-r--r--mysql-test/t/timestamp_sysdate_is_now_func-master.opt1
-rw-r--r--mysql-test/t/timestamp_sysdate_is_now_func.test47
-rw-r--r--mysql-test/t/timezone3.test12
-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/type_newdecimal.test10
-rw-r--r--mysql-test/t/union.test10
-rw-r--r--mysql-test/t/update.test21
-rw-r--r--mysql-test/t/user_var.test22
-rw-r--r--mysql-test/t/variables-notembedded.test80
-rw-r--r--mysql-test/t/variables.test306
-rw-r--r--mysql-test/t/view.test43
-rw-r--r--mysql-test/t/wait_timeout_func.test106
-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
373 files changed, 165860 insertions, 213682 deletions
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/check-testcase.test b/mysql-test/include/check-testcase.test
index 5bdbf6cd072..bf70b66e5df 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -11,12 +11,12 @@
#
# Dump all global variables
#
-show global variables;
+SHOW GLOBAL VARIABLES WHERE variable_name != 'timestamp';
#
# Dump all databases
#
-show databases;
+SHOW DATABASES;
#
# Dump the "test" database, all it's tables and their data
@@ -29,23 +29,23 @@ show databases;
#
--exec $MYSQL_DUMP --skip-comments --skip-lock-tables --no-data mysql
use mysql;
-select * from columns_priv;
-select * from db order by host, db, user;
-select * from func;
-select * from help_category;
-select * from help_keyword;
-select * from help_relation;
-select * from help_relation;
-select * from host;
-select * from proc;
-select * from procs_priv;
-select * from tables_priv;
-select * from time_zone;
-select * from time_zone_leap_second;
-select * from time_zone_name;
-select * from time_zone_transition;
-select * from time_zone_transition_type;
-select * from user;
+SELECT * FROM columns_priv;
+SELECT * FROM db ORDER BY host, db, user;
+SELECT * FROM func;
+SELECT * FROM help_category;
+SELECT * FROM help_keyword;
+SELECT * FROM help_relation;
+SELECT * FROM help_relation;
+SELECT * FROM host;
+SELECT * FROM proc;
+SELECT * FROM procs_priv;
+SELECT * FROM tables_priv;
+SELECT * FROM time_zone;
+SELECT * FROM time_zone_leap_second;
+SELECT * FROM time_zone_name;
+SELECT * FROM time_zone_transition;
+SELECT * FROM time_zone_transition_type;
+SELECT * FROM user;
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/include/wait_condition.inc.moved b/mysql-test/include/wait_condition.inc.moved
deleted file mode 100644
index a41d8080c9b..00000000000
--- a/mysql-test/include/wait_condition.inc.moved
+++ /dev/null
@@ -1,59 +0,0 @@
-# include/wait_condition.inc
-#
-# SUMMARY
-#
-# Waits until the passed statement returns true, or the operation
-# times out.
-#
-# USAGE
-#
-# let $wait_condition=
-# SELECT c = 3 FROM t;
-# --source include/wait_condition.inc
-#
-# OR
-#
-# let $wait_timeout= 60; # Override default 30 seconds with 60.
-# let $wait_condition=
-# SELECT c = 3 FROM t;
-# --source include/wait_condition.inc
-# --echo Executed the test condition $wait_condition_reps times
-#
-# EXAMPLE
-# events_bugs.test, events_time_zone.test
-#
-
---disable_query_log
-
-let $wait_counter= 300;
-if ($wait_timeout)
-{
- let $wait_counter= `SELECT $wait_timeout * 10`;
-}
-# Reset $wait_timeout so that its value won't be used on subsequent
-# calls, and default will be used instead.
-let $wait_timeout= 0;
-
-# Keep track of how many times the wait condition is tested
-# This is used by some tests (e.g., main.status)
-let $wait_condition_reps= 0;
-while ($wait_counter)
-{
- let $success= `$wait_condition`;
- inc $wait_condition_reps;
- if ($success)
- {
- let $wait_counter= 0;
- }
- if (!$success)
- {
- real_sleep 0.1;
- dec $wait_counter;
- }
-}
-if (!$success)
-{
- echo Timeout in wait_condition.inc for $wait_condition;
-}
-
---enable_query_log
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 4b0fad0f818..3b47a89d3d2 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;
}
+
}
}
@@ -879,18 +877,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 3d593697ef6..3c78c3ca064 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 75ee33e97c5..b342421ca2e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2436,6 +2436,12 @@ sub setup_vardir() {
mkpath("$opt_vardir/tmp");
mkpath($opt_tmpdir) if $opt_tmpdir ne "$opt_vardir/tmp";
+ if ($master->[0]->{'path_sock'} !~ m/^$opt_tmpdir/)
+ {
+ mtr_report("Symlinking $master->[0]->{'path_sock'}");
+ symlink($master->[0]->{'path_sock'}, "$opt_tmpdir/master.sock");
+ }
+
# Create new data dirs
foreach my $data_dir (@data_dir_lst)
{
@@ -3601,7 +3607,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);
+ }
}
{
@@ -4357,19 +4372,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 d6986f4a956..f0edfc9bb59 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 b8723a87661..947890d2085 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)
@@ -1752,8 +1754,8 @@ create table t1 like information_schema.character_sets;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
diff --git a/mysql-test/r/csv_alter_table.result b/mysql-test/r/csv_alter_table.result
new file mode 100644
index 00000000000..b406e40b15d
--- /dev/null
+++ b/mysql-test/r/csv_alter_table.result
@@ -0,0 +1,40 @@
+# ===== csv_alter_table.1 =====
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
+ALTER TABLE t1 ADD COLUMN b CHAR(5) NOT NULL;
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+b char(5) NO NULL
+ALTER TABLE t1 DROP COLUMN b;
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+ALTER TABLE t1 MODIFY a BIGINT NOT NULL;
+DESC t1;
+Field Type Null Key Default Extra
+a bigint(20) NO NULL
+ALTER TABLE t1 CHANGE a a INT NOT NULL;
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+DROP TABLE t1;
+# ===== csv_alter_table.2 =====
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
+ALTER TABLE t1 ADD COLUMN b CHAR(5);
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+ALTER TABLE t1 MODIFY a BIGINT;
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+ALTER TABLE t1 CHANGE a a INT;
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field Type Null Key Default Extra
+a int(11) NO NULL
+DROP TABLE t1;
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_filesystem.result b/mysql-test/r/ctype_filesystem.result
new file mode 100644
index 00000000000..b461cf2a1a4
--- /dev/null
+++ b/mysql-test/r/ctype_filesystem.result
@@ -0,0 +1,11 @@
+SET CHARACTER SET utf8;
+SHOW VARIABLES like 'character_sets_dir';
+Variable_name Value
+character_sets_dir MYSQL_TEST_DIR/ß/
+SHOW VARIABLES like 'character_set_filesystem';
+Variable_name Value
+character_set_filesystem latin1
+SHOW VARIABLES like 'character_set_client';
+Variable_name Value
+character_set_client utf8
+SET CHARACTER SET default;
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/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 12e6c9bb492..6f4ae965ca0 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1848,3 +1848,35 @@ select hex(_utf8 B'001111111111');
ERROR HY000: Invalid utf8 character string: 'FF'
select (_utf8 X'616263FF');
ERROR HY000: Invalid utf8 character string: 'FF'
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
+INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70000 1092
+70001 1085
+70002 1065
+ALTER TABLE t1 ADD UNIQUE (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+DROP INDEX b ON t1;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+ALTER TABLE t1 ADD INDEX (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
+CONVERT(a, CHAR) CONVERT(b, CHAR)
+70002 1065
+70001 1085
+70000 1092
+DROP TABLE t1;
+End of 5.0 tests
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/events_scheduling.result b/mysql-test/r/events_scheduling.result
index b7d4578bede..63140bffaa4 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -1,7 +1,8 @@
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
+SET @event_scheduler=@@global.event_scheduler;
SET GLOBAL event_scheduler=OFF;
-Try agian to make sure it's allowed
+Try again to make sure it's allowed
SET GLOBAL event_scheduler=OFF;
SHOW VARIABLES LIKE 'event_scheduler';
Variable_name Value
@@ -64,8 +65,8 @@ INSERT INTO table_4 VALUES (1);
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
IF(SUM(a) >= 4, 'OK', 'ERROR')
OK
-SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
-IF(SUM(a) >= 5, 'OK', 'ERROR')
+SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
+IF(SUM(a) >= 4, 'OK', 'ERROR')
OK
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
IF(SUM(a) >= 1, 'OK', 'ERROR')
@@ -94,4 +95,4 @@ DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
DROP DATABASE events_test;
-SET GLOBAL event_scheduler=OFF;
+SET GLOBAL event_scheduler=@event_scheduler;
diff --git a/mysql-test/r/events_time_zone.result b/mysql-test/r/events_time_zone.result
index b20aa445183..155a9d155af 100644
--- a/mysql-test/r/events_time_zone.result
+++ b/mysql-test/r/events_time_zone.result
@@ -14,6 +14,7 @@ RETURN FLOOR((i % (step * n) + 0.1) / step);
END//
SET @step3= @step * 3;
SET @step6= @step * 6;
+SET @unix_time= UNIX_TIMESTAMP() - 1;
SET @unix_time= @unix_time - @unix_time % @step6;
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
SET @tzid= LAST_INSERT_ID();
@@ -21,7 +22,7 @@ INSERT INTO mysql.time_zone_transition_type
VALUES (@tzid, 0, 0, 0, 'b16420_0');
INSERT INTO mysql.time_zone_transition_type
VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
-INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid);
+INSERT INTO mysql.time_zone_name VALUES ('<TZ_NAME_1>', @tzid);
CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80));
CREATE TABLE t2 (count INT);
INSERT INTO t2 VALUES (1);
@@ -48,7 +49,7 @@ END//
SET TIME_ZONE= '+00:00';
CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e1>");
-SET TIME_ZONE= 'bug16420';
+SET TIME_ZONE= '<TZ_NAME_1>';
CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e2>");
SET GLOBAL EVENT_SCHEDULER= ON;
@@ -86,6 +87,7 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
+ALTER TABLE mysql.time_zone AUTO_INCREMENT = 6;
SET TIME_ZONE= '+00:00';
CREATE TABLE t1 (event CHAR(2), dt DATE, offset INT);
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
@@ -111,8 +113,8 @@ INSERT INTO mysql.time_zone_transition
VALUES (@tzid, @now + 7 * @step, 2);
INSERT INTO mysql.time_zone_transition
VALUES (@tzid, @now + 12 * @step, 3);
-INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid);
-SET TIME_ZONE= 'bug16420_2';
+INSERT INTO mysql.time_zone_name VALUES ('<TZ_NAME_2>', @tzid);
+SET TIME_ZONE= '<TZ_NAME_2>';
SET GLOBAL EVENT_SCHEDULER= ON;
SET GLOBAL EVENT_SCHEDULER= OFF;
Below we should see the following:
@@ -143,6 +145,7 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
+ALTER TABLE mysql.time_zone AUTO_INCREMENT = 6;
DROP FUNCTION round_to_step;
DROP TABLE t_step;
DROP DATABASE mysqltest_db1;
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..efd288613a0 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
@@ -2128,10 +2130,21 @@ Table Checksum
test.t1 2465757603
DROP TABLE t1;
DROP TABLE t1;
+CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
+INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
+CREATE TABLE t1
+(a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
+SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
+a
+DROP TABLE t1;
+DROP TABLE t1;
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/fulltext.result b/mysql-test/r/fulltext.result
index 2fc00073448..0124ced40ce 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -494,3 +494,31 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
a
City Of God
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
+INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
+('test', 1),('test', 2),('test', 3),('test', 4);
+EXPLAIN SELECT * FROM t1
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 fulltext b,a a 0 1 Using where
+EXPLAIN SELECT * FROM t1 USE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 fulltext a a 0 1 Using where
+EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 fulltext a a 0 1 Using where
+EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref b b 5 const 4 Using where
+EXPLAIN SELECT * FROM t1 USE INDEX(b)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref b b 5 const 4 Using where
+EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref b b 5 const 4 Using where
+DROP TABLE t1;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 715f319198c..def03deb351 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -68,7 +68,7 @@ Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
-set @@max_allowed_packet=1048576*100;
+set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
0
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index c198176532f..e0a6c44eb01 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1416,4 +1416,64 @@ 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;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
+SET SQL_MODE='ONLY_FULL_GROUP_BY';
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3
+SELECT COUNT(*) FROM t1 where a=1;
+COUNT(*)
+3
+SELECT COUNT(*),a FROM t1;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
+COUNT(*)
+9
+SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
+FROM t1 outr;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT COUNT(*) FROM t1 a JOIN t1 outr
+ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
+COUNT(*)
+0
+SET SQL_MODE=default;
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 942073e3fbd..63f9ac71e74 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -256,3 +256,15 @@ a
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f")
2003-01-02 10:11:12.001200
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00');
+timediff('2008-09-29 20:10:10','2008-09-30 20:10:10') time('00:00:00')
+-24:00:00 00:00:00
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00');
+timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00')
+0
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
+timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
+1
+SELECT CAST(time('-73:42:12') AS DECIMAL);
+CAST(time('-73:42:12') AS DECIMAL)
+-734212
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/group_concat_max_len_func.result b/mysql-test/r/group_concat_max_len_func.result
index 715a84ce72b..52d67b8d274 100644
--- a/mysql-test/r/group_concat_max_len_func.result
+++ b/mysql-test/r/group_concat_max_len_func.result
@@ -1,31 +1,41 @@
SET @save = @@global.group_concat_max_len;
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
## Creating new table t1 ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
-rollno int NOT NULL,
+rollno INT NOT NULL,
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_034_01-------------------------#'
-## Setting initial value of variable to 4 ##
+## Setting initial value of variable to 4 ##
SET @@global.group_concat_max_len = 4;
-## Inserting some rows in table ##
-INSERT into t1(rollno, name) values(1, 'Record_1');
-INSERT into t1(rollno, name) values(2, 'Record_2');
-INSERT into t1(rollno, name) values(1, 'Record_3');
-INSERT into t1(rollno, name) values(3, 'Record_4');
-INSERT into t1(rollno, name) values(1, 'Record_5');
-INSERT into t1(rollno, name) values(3, 'Record_6');
-INSERT into t1(rollno, name) values(4, 'Record_7');
-INSERT into t1(rollno, name) values(4, 'Record_8');
-## Creating two new connections ##
+## Inserting some rows in table ##
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
+INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
+SELECT * FROM t1 ORDER BY id;
+id rollno name
+1 1 Record_1
+2 2 Record_2
+3 1 Record_3
+4 3 Record_4
+5 1 Record_5
+6 3 Record_6
+7 4 Record_7
+8 4 Record_8
+## Creating two new connections ##
'#--------------------FN_DYNVARS_034_02-------------------------#'
## Connecting with test_con1 ##
-## Accessing data and using group_concat on column whose value is greater than 4 ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
-id rollno group_concat(name)
+## Accessing data and using group_concat on column whose value is greater than 4 ##
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
+id rollno GROUP_CONCAT(name)
1 1 Reco
2 2 Reco
4 3 Reco
@@ -33,10 +43,10 @@ id rollno group_concat(name)
Warnings:
Warning 1260 4 line(s) were cut by GROUP_CONCAT()
## Changing session value of variable and verifying its behavior, ##
-## warning should come here ##
+## warning should come here ##
SET @@session.group_concat_max_len = 10;
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
-id rollno group_concat(name)
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
+id rollno GROUP_CONCAT(name)
1 1 Record_1,R
2 2 Record_2
4 3 Record_4,R
@@ -44,18 +54,18 @@ id rollno group_concat(name)
Warnings:
Warning 1260 3 line(s) were cut by GROUP_CONCAT()
'#--------------------FN_DYNVARS_034_03-------------------------#'
-## Connecting with new connection test_con2 ##
-## Verifying initial value of variable. It should be 4 ##
+## Connecting with new connection test_con2 ##
+## Verifying initial value of variable. It should be 4 ##
SELECT @@session.group_concat_max_len = 4;
@@session.group_concat_max_len = 4
1
-## Setting session value of variable to 20 and verifying variable is concating ##
-## column's value to 20 or not ##
+## Setting session value of variable to 20 and verifying variable is concating ##
+## column's value to 20 or not ##
SET @@session.group_concat_max_len = 20;
## Verifying value of name column, it should not me more than 20 characters ##
## Warning should come here ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
-id rollno group_concat(name)
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
+id rollno GROUP_CONCAT(name)
1 1 Record_1,Record_3,Re
2 2 Record_2
4 3 Record_4,Record_6
@@ -63,17 +73,17 @@ id rollno group_concat(name)
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
'#--------------------FN_DYNVARS_034_04-------------------------#'
-## Setting session value of variable to 26. No warning should appear here ##
-## because the value after concatination is less than 30 ##
+## Setting session value of variable to 26. No warning should appear here ##
+## because the value after concatination is less than 30 ##
SET @@session.group_concat_max_len = 26;
-## Verifying value of name column, it should not give warning now ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
-id rollno group_concat(name)
+## Verifying value of name column, it should not give warning now ##
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
+id rollno GROUP_CONCAT(name)
1 1 Record_1,Record_3,Record_5
2 2 Record_2
4 3 Record_4,Record_6
7 4 Record_7,Record_8
## Dropping table t1 ##
-DROP table t1;
+DROP TABLE t1;
## Disconnecting both the connection ##
SET @@global.group_concat_max_len = @save;
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..85af461eb14 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -517,8 +517,8 @@ drop table t1;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
@@ -526,8 +526,8 @@ set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
@@ -541,8 +541,8 @@ alter table t1 default character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
@@ -716,8 +716,8 @@ select column_type from information_schema.columns
where table_schema="information_schema" and table_name="COLUMNS" and
(column_name="character_set_name" or column_name="collation_name");
column_type
-varchar(64)
-varchar(64)
+varchar(32)
+varchar(32)
select TABLE_ROWS from information_schema.tables where
table_schema="information_schema" and table_name="COLUMNS";
TABLE_ROWS
@@ -758,18 +758,14 @@ 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
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
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 +1642,69 @@ 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
+set global init_connect="drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;";
+select * from information_schema.global_variables where variable_name='init_connect';
+VARIABLE_NAME VARIABLE_VALUE
+INIT_CONNECT drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists t1;
+drop table if exists t1;drop table if exists
+Warnings:
+Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1
+set global init_connect="";
+create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
+SELECT 1;
+1
+1
+select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_status a
+where a.VARIABLE_NAME = b.VARIABLE_NAME;
+a.VARIABLE_VALUE - b.VARIABLE_VALUE
+2
+drop table t0;
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..04dc9ccf2c0 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,9 +137,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 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
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
drop table t1;
+drop table if exists t1;
+create table t1 (f1 int key) partition by key(f1) partitions 2;
+select create_options from information_schema.tables where table_schema="test";
+create_options
+partitioned
+drop table t1;
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 59a243ae6f1..bb976c806d6 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..aeacd054511 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,18 @@ 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;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
+CREATE INDEX i1 on t1 (a(3));
+SELECT * FROM t1 WHERE a = 'abcde';
+a
+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_output_func.result b/mysql-test/r/log_output_func.result
index 8af7f471195..060f930a161 100644
--- a/mysql-test/r/log_output_func.result
+++ b/mysql-test/r/log_output_func.result
@@ -1,13 +1,11 @@
+SET @start_value= @@global.log_output;
+SET @start_general_log= @@global.general_log;
+SET @start_general_log_file= @@global.general_log_file;
'#--------------------FN_DYNVARS_065_01-------------------------#'
SET @@global.log_output = 'NONE';
'connect (con1,localhost,root,,,,)'
-'connection con1'
-SELECT @@global.log_output;
-@@global.log_output
-NONE
SET @@global.log_output = 'TABLE,FILE';
'connect (con2,localhost,root,,,,)'
-'connection con2'
SELECT @@global.log_output;
@@global.log_output
FILE,TABLE
@@ -18,7 +16,7 @@ SET @@global.log_output = 'NONE';
TRUNCATE TABLE mysql.general_log;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
-INSERT INTO t1 value(1);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
abc
abc
@@ -29,25 +27,33 @@ count(*)
SET @@global.log_output = 'TABLE';
TRUNCATE TABLE mysql.general_log;
DROP TABLE IF EXISTS t1;
-create table t1(a int);
-INSERT INTO t1 value(1);
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
abc
abc
-SELECT count(*) from mysql.general_log;
-count(*)
-5
-'Bug#35371: Changing general_log file is crashing server'
-'SET @@global.general_log_file = @log_file;'
+SELECT count(*)>4 FROM mysql.general_log;
+count(*)>4
+1
+SET @@global.general_log = 'OFF';
+FLUSH LOGS;
+SET @@global.general_log_file = 'MYSQLTEST_VARDIR/run/mytest.log';
+SET @@global.general_log = 'ON';
SET @@global.log_output = 'FILE';
TRUNCATE TABLE mysql.general_log;
DROP TABLE IF EXISTS t1;
-create table t1(a int);
-INSERT INTO t1 value(1);
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
abc
abc
-SELECT count(*) from mysql.general_log;
+SELECT count(*) FROM mysql.general_log;
count(*)
0
DROP TABLE t1;
+connection default;
+SET @@global.general_log= 'OFF';
+SET @@global.general_log_file= @start_general_log_file;
+SET @@global.log_output= @start_value;
+SET @@global.general_log= @start_general_log;
+SET @@global.general_log= 'ON';
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/max_allowed_packet_basic.result b/mysql-test/r/max_allowed_packet_basic.result
index 3940cc1b2f2..0745d5a36e1 100644
--- a/mysql-test/r/max_allowed_packet_basic.result
+++ b/mysql-test/r/max_allowed_packet_basic.result
@@ -2,10 +2,7 @@ SET @start_global_value = @@global.max_allowed_packet;
SELECT @start_global_value;
@start_global_value
1048576
-SET @start_session_value = @@session.max_allowed_packet;
-SELECT @start_session_value;
-@start_session_value
-1048576
+SET @@global.max_allowed_packet = DEFAULT;
'#--------------------FN_DYNVARS_070_01-------------------------#'
SET @@global.max_allowed_packet = 1000;
Warnings:
@@ -15,7 +12,9 @@ SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 20000;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SET @@session.max_allowed_packet = DEFAULT;
+ERROR 42000: Variable 'max_allowed_packet' doesn't have a default value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
@@ -24,10 +23,6 @@ SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet = 1048576;
@@global.max_allowed_packet = 1048576
1
-SET @@session.max_allowed_packet = DEFAULT;
-SELECT @@session.max_allowed_packet = 1048576;
-@@session.max_allowed_packet = 1048576
-1
'#--------------------FN_DYNVARS_070_03-------------------------#'
SET @@global.max_allowed_packet = 1024;
SELECT @@global.max_allowed_packet;
@@ -48,25 +43,30 @@ SELECT @@global.max_allowed_packet;
1073740800
'#--------------------FN_DYNVARS_070_04-------------------------#'
SET @@session.max_allowed_packet = 1024;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
SET @@session.max_allowed_packet = 1025;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
SET @@session.max_allowed_packet = 65535;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-64512
+1048576
SET @@session.max_allowed_packet = 1073741824;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1073741824
+1048576
SET @@session.max_allowed_packet = 1073741823;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1073740800
+1048576
'#------------------FN_DYNVARS_070_05-----------------------#'
SET @@global.max_allowed_packet = 0;
Warnings:
@@ -103,37 +103,33 @@ SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@session.max_allowed_packet = 0;
-Warnings:
-Warning 1292 Truncated incorrect max_allowed_packet value: '0'
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
SET @@session.max_allowed_packet = 1023;
-Warnings:
-Warning 1292 Truncated incorrect max_allowed_packet value: '1023'
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
SET @@session.max_allowed_packet = -2;
-Warnings:
-Warning 1292 Truncated incorrect max_allowed_packet value: '0'
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
SET @@session.max_allowed_packet = 65530.34.;
ERROR 42000: You 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 1
SET @@session.max_allowed_packet = 10737418241;
-Warnings:
-Warning 1292 Truncated incorrect max_allowed_packet value: '10737418241'
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1073741824
+1048576
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_allowed_packet = test;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1073741824
+1048576
'#------------------FN_DYNVARS_070_06-----------------------#'
SELECT @@global.max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -166,6 +162,7 @@ SELECT @@max_allowed_packet = @@global.max_allowed_packet;
0
'#---------------------FN_DYNVARS_070_10----------------------#'
SET @@max_allowed_packet = 100000;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@max_allowed_packet = @@local.max_allowed_packet;
@@max_allowed_packet = @@local.max_allowed_packet
1
@@ -174,9 +171,10 @@ SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
1
'#---------------------FN_DYNVARS_070_11----------------------#'
SET max_allowed_packet = 1024;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@max_allowed_packet;
@@max_allowed_packet
-1024
+1048576
SELECT local.max_allowed_packet;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.max_allowed_packet;
@@ -187,7 +185,6 @@ SET @@global.max_allowed_packet = @start_global_value;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1048576
-SET @@session.max_allowed_packet = @start_session_value;
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
diff --git a/mysql-test/r/max_allowed_packet_func.result b/mysql-test/r/max_allowed_packet_func.result
index 9e44bcfb7b1..43da24fa280 100644
--- a/mysql-test/r/max_allowed_packet_func.result
+++ b/mysql-test/r/max_allowed_packet_func.result
@@ -10,24 +10,15 @@ name BLOB
'#--------------------FN_DYNVARS_070_01-------------------------#'
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@session.max_allowed_packet = 1024;
-SET @@session.net_buffer_length = 1024;
+ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
-1024
+1048576
+SET @@session.net_buffer_length = 1024;
+ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.net_buffer_length;
@@session.net_buffer_length
-1024
-## Inserting and fetching data of length greater than 1024 ##
-INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
-SELECT length("aaaaaasssssssssssdddddddfffffgggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk") as len;
-len
-1470
-## Verifying record in table t1 ##
-SELECT * from t1;
-id name
-1 aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-'Bug#35381: Error is not coming on inserting and fetching data of length'
-'greater than max_allowed_packet size at session level';
+16384
'#--------------------FN_DYNVARS_070_02-------------------------#'
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@global.max_allowed_packet = 1024;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index ef623b343e9..cc05efded02 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -830,7 +830,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);
@@ -895,17 +895,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;
@@ -1199,7 +1201,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
@@ -1233,7 +1235,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
@@ -1317,7 +1319,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;
@@ -2006,6 +2008,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/multi_update.result b/mysql-test/r/multi_update.result
index aa88b44f5b4..b8f6aa9e4d4 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -378,29 +378,6 @@ where 0=1;
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
-create table t1 ( a int not null, b int not null) ;
-alter table t1 add index i1(a);
-delete from t1 where a > 2000000;
-create table t2 like t1;
-insert into t2 select * from t1;
-select 't2 rows before small delete', count(*) from t1;
-t2 rows before small delete count(*)
-t2 rows before small delete 2000000
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
-select 't2 rows after small delete', count(*) from t2;
-t2 rows after small delete count(*)
-t2 rows after small delete 1999999
-select 't1 rows after small delete', count(*) from t1;
-t1 rows after small delete count(*)
-t1 rows after small delete 1999999
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
-select 't2 rows after big delete', count(*) from t2;
-t2 rows after big delete count(*)
-t2 rows after big delete 1900001
-select 't1 rows after big delete', count(*) from t1;
-t1 rows after big delete count(*)
-t1 rows after big delete 1900001
-drop table t1,t2;
CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
diff --git a/mysql-test/r/multi_update2.result b/mysql-test/r/multi_update2.result
new file mode 100644
index 00000000000..3712e638f40
--- /dev/null
+++ b/mysql-test/r/multi_update2.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
+# The protocolling of many inserts into t1 is suppressed.
+ALTER TABLE t1 ADD INDEX i1(a);
+DELETE FROM t1 WHERE a > 2000000;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1;
+SELECT 't2 rows before small delete', COUNT(*) FROM t1;
+t2 rows before small delete COUNT(*)
+t2 rows before small delete 2000000
+DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 2;
+SELECT 't2 rows after small delete', COUNT(*) FROM t2;
+t2 rows after small delete COUNT(*)
+t2 rows after small delete 1999999
+SELECT 't1 rows after small delete', COUNT(*) FROM t1;
+t1 rows after small delete COUNT(*)
+t1 rows after small delete 1999999
+DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 100*1000;
+SELECT 't2 rows after big delete', COUNT(*) FROM t2;
+t2 rows after big delete COUNT(*)
+t2 rows after big delete 1900001
+SELECT 't1 rows after big delete', COUNT(*) FROM t1;
+t1 rows after big delete COUNT(*)
+t1 rows after big delete 1900001
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index b8fdd04d24a..e222d66c5b6 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -98,6 +98,19 @@ drop view v_bug25347;
drop table t_bug25347;
drop database d_bug25347;
use test;
+create view v1 as select * from information_schema.routines;
+check table v1, information_schema.routines;
+Table Op Msg_type Msg_text
+test.v1 check status OK
+information_schema.routines check note The storage engine for the table doesn't support check
+drop view v1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+test.t1
+Error : Incorrect information in file: './test/t1.frm'
+error : Corrupt
+test.t2 OK
+DROP TABLE t1, t2;
End of 5.0 tests
create table t1(a int);
create view v1 as select * from t1;
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 3e0b4f80f84..ec397d8fb89 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/net_buffer_length_basic.result b/mysql-test/r/net_buffer_length_basic.result
index ddaad3dfa91..be7e9082332 100644
--- a/mysql-test/r/net_buffer_length_basic.result
+++ b/mysql-test/r/net_buffer_length_basic.result
@@ -1,5 +1,5 @@
SET @start_global_value = @@global.net_buffer_length;
-SET @start_session_value = @@session.net_buffer_length;
+SET @@global.net_buffer_length = DEFAULT;
'#--------------------FN_DYNVARS_109_01-------------------------#'
SET @@global.net_buffer_length = 10000;
SET @@global.net_buffer_length = DEFAULT;
@@ -7,7 +7,9 @@ SELECT @@global.net_buffer_length;
@@global.net_buffer_length
16384
SET @@session.net_buffer_length = 20000;
+ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
SET @@session.net_buffer_length = DEFAULT;
+ERROR 42000: Variable 'net_buffer_length' doesn't have a default value
SELECT @@session.net_buffer_length;
@@session.net_buffer_length
16384
@@ -16,10 +18,6 @@ SET @@global.net_buffer_length = DEFAULT;
SELECT @@global.net_buffer_length = 16384;
@@global.net_buffer_length = 16384
1
-SET @@session.net_buffer_length = DEFAULT;
-SELECT @@session.net_buffer_length = 16384;
-@@session.net_buffer_length = 16384
-1
'#--------------------FN_DYNVARS_109_03-------------------------#'
SET @@global.net_buffer_length = 1024;
SELECT @@global.net_buffer_length;
@@ -43,27 +41,6 @@ SELECT @@global.net_buffer_length;
64512
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_109_04-------------------------#'
-SET @@session.net_buffer_length = 1024;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1024
-SET @@session.net_buffer_length = 1025;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1024
-SET @@session.net_buffer_length = 1048576;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1048576
-SET @@session.net_buffer_length = 1048575;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1047552
-SET @@session.net_buffer_length = 65535;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#------------------FN_DYNVARS_109_05-----------------------#'
SET @@global.net_buffer_length = 0;
Warnings:
@@ -105,42 +82,12 @@ ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1048576
-SET @@session.net_buffer_length = 0;
-Warnings:
-Warning 1292 Truncated incorrect net_buffer_length value: '0'
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1024
-SET @@session.net_buffer_length = -2;
-Warnings:
-Warning 1292 Truncated incorrect net_buffer_length value: '0'
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1024
-SET @@session.net_buffer_length = 1048577;
-Warnings:
-Warning 1292 Truncated incorrect net_buffer_length value: '1048577'
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1048576
-SET @@session.net_buffer_length = 1048576002;
-Warnings:
-Warning 1292 Truncated incorrect net_buffer_length value: '1048576002'
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-1048576
-SET @@session.net_buffer_length = 65530.34.;
-ERROR 42000: You 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 1
-SET @@session.net_buffer_length = 65550;
-SELECT @@session.net_buffer_length;
-@@session.net_buffer_length
-65536
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.net_buffer_length = test;
ERROR 42000: Incorrect argument type to variable 'net_buffer_length'
SELECT @@session.net_buffer_length;
@@session.net_buffer_length
-65536
+16384
'#------------------FN_DYNVARS_109_06-----------------------#'
SELECT @@global.net_buffer_length = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -172,18 +119,10 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
@@net_buffer_length = @@global.net_buffer_length
0
'#---------------------FN_DYNVARS_109_10----------------------#'
-SET @@net_buffer_length = 100000;
-SELECT @@net_buffer_length = @@local.net_buffer_length;
-@@net_buffer_length = @@local.net_buffer_length
-1
-SELECT @@local.net_buffer_length = @@session.net_buffer_length;
-@@local.net_buffer_length = @@session.net_buffer_length
-1
'#---------------------FN_DYNVARS_109_11----------------------#'
-SET net_buffer_length = 1024;
SELECT @@net_buffer_length;
@@net_buffer_length
-1024
+16384
SELECT local.net_buffer_length;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.net_buffer_length;
@@ -191,4 +130,3 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT net_buffer_length = @@session.net_buffer_length;
ERROR 42S22: Unknown column 'net_buffer_length' in 'field list'
SET @@global.net_buffer_length = @start_global_value;
-SET @@session.net_buffer_length = @start_session_value;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index a042d0a5dc3..70151acda22 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -73,11 +73,10 @@ variable_name LIKE 'SSL_CALLBACK_CACHE_HITS';
END$$
SELECT variable_name, variable_value FROM thread_status;
variable_name variable_value
-SSL_ACCEPTS 0
-SSL_CALLBACK_CACHE_HITS 0
+SSL_ACCEPTS #
+SSL_CALLBACK_CACHE_HITS #
DROP TABLE thread_status;
SET GLOBAL event_scheduler=0;
-End of 5.1 tests
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher AES128-SHA
@@ -192,3 +191,15 @@ UNLOCK TABLES;
SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem'
mysqldump: Got error: 2026: SSL connection error when trying to connect
DROP TABLE t1;
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+Variable_name Value
+Ssl_cipher EDH-RSA-DES-CBC3-SHA
+Variable_name Value
+Ssl_cipher EDH-RSA-DES-CBC-SHA
+Variable_name Value
+Ssl_cipher RC4-SHA
+select 'is still running; no cipher request crashed the server' as result from dual;
+result
+is still running; no cipher request crashed the server
+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/packet.result b/mysql-test/r/packet.result
index df0d9ff9adc..fa2fb33d278 100644
--- a/mysql-test/r/packet.result
+++ b/mysql-test/r/packet.result
@@ -1,32 +1,22 @@
set global max_allowed_packet=100;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
-set max_allowed_packet=100;
-Warnings:
-Warning 1292 Truncated incorrect max_allowed_packet value: '100'
set global net_buffer_length=100;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '100'
-set net_buffer_length=100;
-Warnings:
-Warning 1292 Truncated incorrect net_buffer_length value: '100'
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
len
1024
select repeat('a',2000);
repeat('a',2000)
-NULL
-Warnings:
-Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
set global max_allowed_packet=default;
-set max_allowed_packet=default;
set global net_buffer_length=default;
-set net_buffer_length=default;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
len
100
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index a441a841a07..93684ba05e5 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,5 +1,91 @@
drop table if exists t1, t2;
CREATE TABLE t1 (
+pk INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (pk)
+)
+/*!50100 PARTITION BY HASH (pk)
+PARTITIONS 2 */;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
+pk
+DROP TABLE t1;
+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,
c INT NOT NULL,
@@ -133,7 +219,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 +388,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 +420,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 +598,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 +624,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 +653,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 +678,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 +741,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 +788,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 +808,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 +821,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 +843,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 +856,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 +870,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 +1016,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 +1040,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 +1127,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 +1141,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 +1339,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 +1377,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 +1393,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 +1466,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 +1617,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 +1644,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 +1784,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 +1817,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..af277e5ce40 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,3 +1,84 @@
+drop table if exists t1;
+CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
+PARTITION BY RANGE(id) (
+PARTITION p0 VALUES LESS THAN (5),
+PARTITION p1 VALUES LESS THAN (10),
+PARTITION p2 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
+(9,9), (10,10), (11,11);
+SET @old_tx_isolation := @@session.tx_isolation;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET autocommit = 0;
+UPDATE t1 SET DATA = data*2 WHERE id = 3;
+UPDATE t1 SET data = data*2 WHERE data = 2;
+SET @@session.tx_isolation = @old_tx_isolation;
+DROP TABLE t1;
+# 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 +153,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 +166,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 +244,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/perror-win.result b/mysql-test/r/perror-win.result
new file mode 100644
index 00000000000..1d42235cc14
--- /dev/null
+++ b/mysql-test/r/perror-win.result
@@ -0,0 +1,6 @@
+MySQL error code 150: Foreign key constraint is incorrectly formed
+Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
+OS error code 23: Too many open files in system
+Win32 error code 23: Data error (cyclic redundancy check).
+Win32 error code 1062: The service has not been started.
+Illegal error code: 30000
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..d054e5cdc05 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -100,19 +100,19 @@ drop table t1;
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 20480 5 Y 0 0 8
+def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 20480 5 Y 0 0 8
+def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 20480 0 Y 0 0 8
+def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -130,7 +130,7 @@ def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
-def TABLES TABLE_COLLATION Collation 253 64 0 Y 0 0 8
+def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
@@ -858,17 +858,17 @@ set names utf8;
----------------------------------------------------------------
SHOW CHARACTER SET LIKE 'utf8';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 192 4 N 1 0 33
+def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
-def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 192 15 N 1 0 33
+def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
Charset Description Default collation Maxlen
utf8 UTF-8 Unicode utf8_general_ci 3
----------------------------------------------------------------
SHOW COLLATION LIKE 'latin1_bin';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLLATIONS COLLATION_NAME Collation 253 192 10 N 1 0 33
-def COLLATIONS CHARACTER_SET_NAME Charset 253 192 6 N 1 0 33
+def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
+def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
def COLLATIONS ID Id 8 11 2 N 32769 0 63
def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
@@ -935,7 +935,7 @@ def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
-def TABLES TABLE_COLLATION TABLE_COLLATION 253 192 17 Y 0 0 33
+def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
@@ -966,8 +966,8 @@ def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
-def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 192 0 Y 0 0 33
-def COLUMNS COLLATION_NAME COLLATION_NAME 253 192 0 Y 0 0 33
+def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
+def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
@@ -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
----------------------------------------------------------------
@@ -1125,7 +1125,7 @@ def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33
+def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
@@ -1180,7 +1180,7 @@ def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33
+def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
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/subselect.result b/mysql-test/r/subselect.result
index 5f84259ac29..c1c81847b13 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4448,4 +4448,34 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT
a incorrect
1 1
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+CREATE VIEW v1 AS
+SELECT t2.c AS c FROM t1, t2
+WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+UPDATE v1 SET c=1;
+CREATE VIEW v2 (a,b) AS
+SELECT t2.id, t2.c AS c FROM t1, t2
+WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+INSERT INTO v2(a,b) VALUES (2,2);
+ERROR HY000: CHECK OPTION failed 'test.v2'
+INSERT INTO v2(a,b) VALUES (1,2);
+SELECT * FROM v1;
+c
+1
+1
+1
+1
+2
+2
+CREATE VIEW v3 AS
+SELECT t2.c AS c FROM t2
+WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+DELETE FROM v3;
+DROP VIEW v1,v2,v3;
+DROP TABLE t1,t2;
End of 5.1 tests.
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..03bdeaceb58 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` (
@@ -148,24 +148,24 @@ DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data/mysql';
-ERROR HY000: Incorrect arguments to INDEX DIRECTORY
+DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/test';
-ERROR HY000: Incorrect arguments to DATA DIRECTORY
+DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/';
-ERROR HY000: Incorrect arguments to DATA DIRECTORY
+DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data';
-ERROR HY000: Incorrect arguments to INDEX DIRECTORY
+DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data_var';
ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errcode: 2)
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/timestamp_func.result b/mysql-test/r/timestamp_func.result
index ed51cec4227..1b49331c069 100644
--- a/mysql-test/r/timestamp_func.result
+++ b/mysql-test/r/timestamp_func.result
@@ -1,33 +1,25 @@
-** Setup **
-
-** Connecting con0 using root **
** Connecting con1 using root **
-'#-----------------------------FN_DYNVARS_179_01------------------#'
-** Connection con0 **
-SET @ts_old = @@SESSION.timestamp;
-waiting 1 sec
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT date(now()) = date(sysdate());
+date(now()) = date(sysdate())
+1
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+1
+** Connecting con0 using root **
+SELECT @@session.timestamp != 1100000000;
+@@session.timestamp != 1100000000
+1
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
1
-1 means >=1 expected is true
** Connection con1 **
-SET @ts_old = @@SESSION.timestamp;
-waiting 4 sec
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT @@session.timestamp != 1000000000;
+@@session.timestamp != 1000000000
1
-1 means >=4 expected is true
-'#-----------------------------FN_DYNVARS_179_02---------------------#'
-SET @ts_old = @@SESSION.timestamp;
-Changing time zone
-SET time_zone = 'MET';
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT @@session.timestamp = 1100000000;
+@@session.timestamp = 1100000000
1
-1 means >=1 expected is true
-** Cleanup **
** Connection default **
Disconnecting Connections con0, con1
diff --git a/mysql-test/r/timestamp_sysdate_is_now_func.result b/mysql-test/r/timestamp_sysdate_is_now_func.result
new file mode 100644
index 00000000000..e24ff2e962a
--- /dev/null
+++ b/mysql-test/r/timestamp_sysdate_is_now_func.result
@@ -0,0 +1,25 @@
+** Connecting con1 using root **
+SELECT date(now()) = date(sysdate());
+date(now()) = date(sysdate())
+1
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+0
+** Connecting con0 using root **
+SELECT @@session.timestamp != 1100000000;
+@@session.timestamp != 1100000000
+1
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+0
+** Connection con1 **
+SELECT @@session.timestamp != 1000000000;
+@@session.timestamp != 1000000000
+1
+SELECT @@session.timestamp = 1100000000;
+@@session.timestamp = 1100000000
+1
+** Connection default **
+Disconnecting Connections con0, con1
diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result
index 32db7ea7fa9..ed15172a0e9 100644
--- a/mysql-test/r/timezone2.result
+++ b/mysql-test/r/timezone2.result
@@ -110,7 +110,7 @@ i ts
362793610 1981-07-01 04:00:00
select from_unixtime(362793609);
from_unixtime(362793609)
-1981-07-01 03:59:60
+1981-07-01 03:59:59
drop table t1;
create table t1 (ts timestamp);
set time_zone='UTC';
diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result
index ec0b6045f93..ceac4a5aefb 100644
--- a/mysql-test/r/timezone3.result
+++ b/mysql-test/r/timezone3.result
@@ -17,6 +17,9 @@ insert into t1 values
insert into t1 values
(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00');
+insert into t1 values
+(unix_timestamp('2009-01-01 02:59:59'),'2009-01-01 02:59:59'),
+(unix_timestamp('2009-01-01 03:00:00'),'2009-01-01 03:00:00');
select i, from_unixtime(i), c from t1;
i from_unixtime(i) c
1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00
@@ -31,6 +34,8 @@ i from_unixtime(i) c
1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59
362793608 1981-07-01 03:59:59 1981-07-01 03:59:59
362793610 1981-07-01 04:00:00 1981-07-01 04:00:00
+1230768022 2009-01-01 02:59:59 2009-01-01 02:59:59
+1230768024 2009-01-01 03:00:00 2009-01-01 03:00:00
drop table t1;
create table t1 (ts timestamp);
insert into t1 values (19730101235900), (20040101235900);
@@ -39,3 +44,6 @@ ts
1973-01-01 23:59:00
2004-01-01 23:59:00
drop table t1;
+SELECT FROM_UNIXTIME(1230768022), FROM_UNIXTIME(1230768023), FROM_UNIXTIME(1230768024);
+FROM_UNIXTIME(1230768022) FROM_UNIXTIME(1230768023) FROM_UNIXTIME(1230768024)
+2009-01-01 02:59:59 2009-01-01 02:59:59 2009-01-01 03:00:00
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/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 37b77dc4dc8..f2b08d1c6b7 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1534,6 +1534,21 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
(1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000)
0.812988073953673124592306939480
+create table t1 as select 5.05 / 0.014;
+Warnings:
+Note 1265 Data truncated for column '5.05 / 0.014' at row 1
+show warnings;
+Level Code Message
+Note 1265 Data truncated for column '5.05 / 0.014' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `5.05 / 0.014` decimal(10,6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+5.05 / 0.014
+360.714286
+DROP TABLE t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 3f99a053df4..2a10f34d081 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1343,10 +1343,10 @@ t3 CREATE TABLE `t3` (
`left(a,100000000)` longtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop tables t1,t2,t3;
-SELECT @tmp_max:= @@max_allowed_packet;
-@tmp_max:= @@max_allowed_packet
+SELECT @tmp_max:= @@global.max_allowed_packet;
+@tmp_max:= @@global.max_allowed_packet
1048576
-SET max_allowed_packet=25000000;
+SET @@global.max_allowed_packet=25000000;
CREATE TABLE t1 (a mediumtext);
CREATE TABLE t2 (b varchar(20));
INSERT INTO t1 VALUES ('a');
@@ -1384,7 +1384,7 @@ t3 CREATE TABLE `t3` (
`a` varbinary(510) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLES t1,t2,t3;
-SET max_allowed_packet:= @tmp_max;
+SET @@global.max_allowed_packet:= @tmp_max;
create table t1 ( id int not null auto_increment, primary key (id), col1 int);
insert into t1 (col1) values (2),(3),(4),(5),(6);
select 99 union all select id from t1 order by 1;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index b861ec96882..7a51649fac5 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -491,4 +491,15 @@ update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
affected rows: 127
info: Rows matched: 128 Changed: 127 Warnings: 0
drop table t1,t2;
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS INT RETURN f1();
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1);
+UPDATE t1 SET i = 3 WHERE f1();
+ERROR HY000: Recursive stored functions and triggers are not allowed.
+UPDATE t1 SET i = f1();
+ERROR HY000: Recursive stored functions and triggers are not allowed.
+DROP TABLE t1;
+DROP FUNCTION f1;
End of 5.0 tests
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-notembedded.result b/mysql-test/r/variables-notembedded.result
index 48a1719e2c7..571b6605674 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -15,3 +15,95 @@ slave_skip_errors 3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
+
+#
+SHOW VARIABLES like 'log_slave_updates';
+Variable_name Value
+log_slave_updates OFF
+SELECT @@session.log_slave_updates;
+ERROR HY000: Variable 'log_slave_updates' is a GLOBAL variable
+SELECT @@global.log_slave_updates;
+@@global.log_slave_updates
+0
+SET @@session.log_slave_updates= true;
+ERROR HY000: Variable 'log_slave_updates' is a read only variable
+SET @@global.log_slave_updates= true;
+ERROR HY000: Variable 'log_slave_updates' is a read only variable
+#
+SHOW VARIABLES like 'relay_log';
+Variable_name Value
+relay_log
+SELECT @@session.relay_log;
+ERROR HY000: Variable 'relay_log' is a GLOBAL variable
+SELECT @@global.relay_log;
+@@global.relay_log
+NULL
+SET @@session.relay_log= 'x';
+ERROR HY000: Variable 'relay_log' is a read only variable
+SET @@global.relay_log= 'x';
+ERROR HY000: Variable 'relay_log' is a read only variable
+#
+SHOW VARIABLES like 'relay_log_index';
+Variable_name Value
+relay_log_index
+SELECT @@session.relay_log_index;
+ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
+SELECT @@global.relay_log_index;
+@@global.relay_log_index
+NULL
+SET @@session.relay_log_index= 'x';
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+SET @@global.relay_log_index= 'x';
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+#
+SHOW VARIABLES like 'relay_log_info_file';
+Variable_name Value
+relay_log_info_file relay-log.info
+SELECT @@session.relay_log_info_file;
+ERROR HY000: Variable 'relay_log_info_file' is a GLOBAL variable
+SELECT @@global.relay_log_info_file;
+@@global.relay_log_info_file
+relay-log.info
+SET @@session.relay_log_info_file= 'x';
+ERROR HY000: Variable 'relay_log_info_file' is a read only variable
+SET @@global.relay_log_info_file= 'x';
+ERROR HY000: Variable 'relay_log_info_file' is a read only variable
+#
+SHOW VARIABLES like 'relay_log_space_limit';
+Variable_name Value
+relay_log_space_limit 0
+SELECT @@session.relay_log_space_limit;
+ERROR HY000: Variable 'relay_log_space_limit' is a GLOBAL variable
+SELECT @@global.relay_log_space_limit;
+@@global.relay_log_space_limit
+0
+SET @@session.relay_log_space_limit= 7;
+ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
+SET @@global.relay_log_space_limit= 7;
+ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
+#
+SHOW VARIABLES like 'slave_load_tmpdir';
+Variable_name Value
+slave_load_tmpdir #
+SELECT @@session.slave_load_tmpdir;
+ERROR HY000: Variable 'slave_load_tmpdir' is a GLOBAL variable
+SELECT @@global.slave_load_tmpdir;
+@@global.slave_load_tmpdir
+#
+SET @@session.slave_load_tmpdir= 'x';
+ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
+SET @@global.slave_load_tmpdir= 'x';
+ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
+#
+SHOW VARIABLES like 'slave_skip_errors';
+Variable_name Value
+slave_skip_errors 3,100,137,643,1752
+SELECT @@session.slave_skip_errors;
+ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
+SELECT @@global.slave_skip_errors;
+@@global.slave_skip_errors
+3,100,137,643,1752
+SET @@session.slave_skip_errors= 7;
+ERROR HY000: Variable 'slave_skip_errors' is a read only variable
+SET @@global.slave_skip_errors= 7;
+ERROR HY000: Variable 'slave_skip_errors' is a read only variable
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 3f66599751d..ac78d8e1871 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';
@@ -228,7 +228,6 @@ VARIABLE_NAME VARIABLE_VALUE
MYISAM_MAX_SORT_FILE_SIZE FILE_SIZE
set global net_retry_count=10, session net_retry_count=10;
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
-set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
show global variables like 'net_%';
Variable_name Value
net_buffer_length 1024
@@ -243,57 +242,45 @@ NET_RETRY_COUNT 10
NET_WRITE_TIMEOUT 200
show session variables like 'net_%';
Variable_name Value
-net_buffer_length 2048
-net_read_timeout 600
+net_buffer_length 16384
+net_read_timeout 30
net_retry_count 10
-net_write_timeout 500
+net_write_timeout 60
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
-NET_BUFFER_LENGTH 2048
-NET_READ_TIMEOUT 600
+NET_BUFFER_LENGTH 16384
+NET_READ_TIMEOUT 30
NET_RETRY_COUNT 10
-NET_WRITE_TIMEOUT 500
-set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+NET_WRITE_TIMEOUT 60
+set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
show global variables like 'net_%';
Variable_name Value
-net_buffer_length 1024
+net_buffer_length 7168
net_read_timeout 900
net_retry_count 10
net_write_timeout 1000
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
-NET_BUFFER_LENGTH 1024
+NET_BUFFER_LENGTH 7168
NET_READ_TIMEOUT 900
NET_RETRY_COUNT 10
NET_WRITE_TIMEOUT 1000
-show session variables like 'net_%';
-Variable_name Value
-net_buffer_length 7168
-net_read_timeout 600
-net_retry_count 10
-net_write_timeout 500
-select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
-VARIABLE_NAME VARIABLE_VALUE
-NET_BUFFER_LENGTH 7168
-NET_READ_TIMEOUT 600
-NET_RETRY_COUNT 10
-NET_WRITE_TIMEOUT 500
-set net_buffer_length=1;
+set global net_buffer_length=1;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '1'
-show variables like 'net_buffer_length';
+show global variables like 'net_buffer_length';
Variable_name Value
net_buffer_length 1024
-select * from information_schema.session_variables where variable_name like 'net_buffer_length';
+select * from information_schema.global_variables where variable_name like 'net_buffer_length';
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 1024
-set net_buffer_length=2000000000;
+set global net_buffer_length=2000000000;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '2000000000'
-show variables like 'net_buffer_length';
+show global variables like 'net_buffer_length';
Variable_name Value
net_buffer_length 1048576
-select * from information_schema.session_variables where variable_name like 'net_buffer_length';
+select * from information_schema.global_variables where variable_name like 'net_buffer_length';
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 1048576
set character set cp1251_koi8;
@@ -461,7 +448,7 @@ select @@long_query_time;
@@long_query_time
100.000001
set low_priority_updates=1;
-set max_allowed_packet=100;
+set global max_allowed_packet=100;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
set global max_binlog_cache_size=100;
@@ -485,7 +472,7 @@ select @@max_user_connections;
100
set global max_write_lock_count=100;
set myisam_sort_buffer_size=100;
-set net_buffer_length=100;
+set global net_buffer_length=100;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '100'
set net_read_timeout=100;
@@ -1024,3 +1011,329 @@ SET GLOBAL log_output = 0;
ERROR 42000: Variable 'log_output' can't be set to the value of '0'
# -- End of Bug#34820.
+
+#
+SHOW VARIABLES like 'ft_max_word_len';
+Variable_name Value
+ft_max_word_len 84
+SELECT @@session.ft_max_word_len;
+ERROR HY000: Variable 'ft_max_word_len' is a GLOBAL variable
+SELECT @@global.ft_max_word_len;
+@@global.ft_max_word_len
+84
+SET @@session.ft_max_word_len= 7;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
+SET @@global.ft_max_word_len= 7;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
+#
+SHOW VARIABLES like 'ft_min_word_len';
+Variable_name Value
+ft_min_word_len 4
+SELECT @@session.ft_min_word_len;
+ERROR HY000: Variable 'ft_min_word_len' is a GLOBAL variable
+SELECT @@global.ft_min_word_len;
+@@global.ft_min_word_len
+4
+SET @@session.ft_min_word_len= 7;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
+SET @@global.ft_min_word_len= 7;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
+#
+SHOW VARIABLES like 'ft_query_expansion_limit';
+Variable_name Value
+ft_query_expansion_limit 20
+SELECT @@session.ft_query_expansion_limit;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a GLOBAL variable
+SELECT @@global.ft_query_expansion_limit;
+@@global.ft_query_expansion_limit
+20
+SET @@session.ft_query_expansion_limit= 7;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
+SET @@global.ft_query_expansion_limit= 7;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
+#
+SHOW VARIABLES like 'ft_stopword_file';
+Variable_name Value
+ft_stopword_file (built-in)
+SELECT @@session.ft_stopword_file;
+ERROR HY000: Variable 'ft_stopword_file' is a GLOBAL variable
+SELECT @@global.ft_stopword_file;
+@@global.ft_stopword_file
+(built-in)
+SET @@session.ft_stopword_file= 'x';
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
+SET @@global.ft_stopword_file= 'x';
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
+#
+SHOW VARIABLES like 'back_log';
+Variable_name Value
+back_log 50
+SELECT @@session.back_log;
+ERROR HY000: Variable 'back_log' is a GLOBAL variable
+SELECT @@global.back_log;
+@@global.back_log
+50
+SET @@session.back_log= 7;
+ERROR HY000: Variable 'back_log' is a read only variable
+SET @@global.back_log= 7;
+ERROR HY000: Variable 'back_log' is a read only variable
+#
+SHOW VARIABLES like 'large_files_support';
+Variable_name Value
+large_files_support #
+SELECT @@session.large_files_support;
+ERROR HY000: Variable 'large_files_support' is a GLOBAL variable
+SELECT @@global.large_files_support;
+@@global.large_files_support
+#
+SET @@session.large_files_support= true;
+ERROR HY000: Variable 'large_files_support' is a read only variable
+SET @@global.large_files_support= true;
+ERROR HY000: Variable 'large_files_support' is a read only variable
+#
+SHOW VARIABLES like 'character_sets_dir';
+Variable_name Value
+character_sets_dir #
+SELECT @@session.character_sets_dir;
+ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable
+SELECT @@global.character_sets_dir;
+@@global.character_sets_dir
+#
+SET @@session.character_sets_dir= 'x';
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
+SET @@global.character_sets_dir= 'x';
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
+#
+SHOW VARIABLES like 'init_file';
+Variable_name Value
+init_file #
+SELECT @@session.init_file;
+ERROR HY000: Variable 'init_file' is a GLOBAL variable
+SELECT @@global.init_file;
+@@global.init_file
+#
+SET @@session.init_file= 'x';
+ERROR HY000: Variable 'init_file' is a read only variable
+SET @@global.init_file= 'x';
+ERROR HY000: Variable 'init_file' is a read only variable
+#
+SHOW VARIABLES like 'language';
+Variable_name Value
+language #
+SELECT @@session.language;
+ERROR HY000: Variable 'language' is a GLOBAL variable
+SELECT @@global.language;
+@@global.language
+#
+SET @@session.language= 'x';
+ERROR HY000: Variable 'language' is a read only variable
+SET @@global.language= 'x';
+ERROR HY000: Variable 'language' is a read only variable
+#
+SHOW VARIABLES like 'large_page_size';
+Variable_name Value
+large_page_size #
+SELECT @@session.large_page_size;
+ERROR HY000: Variable 'large_page_size' is a GLOBAL variable
+SELECT @@global.large_page_size;
+@@global.large_page_size
+#
+SET @@session.large_page_size= 7;
+ERROR HY000: Variable 'large_page_size' is a read only variable
+SET @@global.large_page_size= 7;
+ERROR HY000: Variable 'large_page_size' is a read only variable
+#
+SHOW VARIABLES like 'large_pages';
+Variable_name Value
+large_pages #
+SELECT @@session.large_pages;
+ERROR HY000: Variable 'large_pages' is a GLOBAL variable
+SELECT @@global.large_pages;
+@@global.large_pages
+#
+SET @@session.large_pages= true;
+ERROR HY000: Variable 'large_pages' is a read only variable
+SET @@global.large_pages= true;
+ERROR HY000: Variable 'large_pages' is a read only variable
+#
+SHOW VARIABLES like 'log_bin';
+Variable_name Value
+log_bin OFF
+SELECT @@session.log_bin;
+ERROR HY000: Variable 'log_bin' is a GLOBAL variable
+SELECT @@global.log_bin;
+@@global.log_bin
+0
+SET @@session.log_bin= true;
+ERROR HY000: Variable 'log_bin' is a read only variable
+SET @@global.log_bin= true;
+ERROR HY000: Variable 'log_bin' is a read only variable
+#
+SHOW VARIABLES like 'log_error';
+Variable_name Value
+log_error #
+SELECT @@session.log_error;
+ERROR HY000: Variable 'log_error' is a GLOBAL variable
+SELECT @@global.log_error;
+@@global.log_error
+#
+SET @@session.log_error= 'x';
+ERROR HY000: Variable 'log_error' is a read only variable
+SET @@global.log_error= 'x';
+ERROR HY000: Variable 'log_error' is a read only variable
+#
+SHOW VARIABLES like 'lower_case_file_system';
+Variable_name Value
+lower_case_file_system #
+SELECT @@session.lower_case_file_system;
+ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable
+SELECT @@global.lower_case_file_system;
+@@global.lower_case_file_system
+#
+SET @@session.lower_case_file_system= true;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
+SET @@global.lower_case_file_system= true;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
+#
+SHOW VARIABLES like 'lower_case_table_names';
+Variable_name Value
+lower_case_table_names #
+SELECT @@session.lower_case_table_names;
+ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable
+SELECT @@global.lower_case_table_names;
+@@global.lower_case_table_names
+#
+SET @@session.lower_case_table_names= 7;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
+SET @@global.lower_case_table_names= 7;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
+#
+SHOW VARIABLES like 'myisam_recover_options';
+Variable_name Value
+myisam_recover_options OFF
+SELECT @@session.myisam_recover_options;
+ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
+SELECT @@global.myisam_recover_options;
+@@global.myisam_recover_options
+OFF
+SET @@session.myisam_recover_options= 'x';
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
+SET @@global.myisam_recover_options= 'x';
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
+#
+SHOW VARIABLES like 'open_files_limit';
+Variable_name Value
+open_files_limit #
+SELECT @@session.open_files_limit;
+ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable
+SELECT @@global.open_files_limit;
+@@global.open_files_limit
+#
+SET @@session.open_files_limit= 7;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
+SET @@global.open_files_limit= 7;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
+#
+SHOW VARIABLES like 'pid_file';
+Variable_name Value
+pid_file #
+SELECT @@session.pid_file;
+ERROR HY000: Variable 'pid_file' is a GLOBAL variable
+SELECT @@global.pid_file;
+@@global.pid_file
+#
+SET @@session.pid_file= 'x';
+ERROR HY000: Variable 'pid_file' is a read only variable
+SET @@global.pid_file= 'x';
+ERROR HY000: Variable 'pid_file' is a read only variable
+#
+SHOW VARIABLES like 'plugin_dir';
+Variable_name Value
+plugin_dir #
+SELECT @@session.plugin_dir;
+ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
+SELECT @@global.plugin_dir;
+@@global.plugin_dir
+#
+SET @@session.plugin_dir= 'x';
+ERROR HY000: Variable 'plugin_dir' is a read only variable
+SET @@global.plugin_dir= 'x';
+ERROR HY000: Variable 'plugin_dir' is a read only variable
+#
+SHOW VARIABLES like 'port';
+Variable_name Value
+port #
+SELECT @@session.port;
+ERROR HY000: Variable 'port' is a GLOBAL variable
+SELECT @@global.port;
+@@global.port
+#
+SET @@session.port= 7;
+ERROR HY000: Variable 'port' is a read only variable
+SET @@global.port= 7;
+ERROR HY000: Variable 'port' is a read only variable
+#
+SHOW VARIABLES like 'protocol_version';
+Variable_name Value
+protocol_version 10
+SELECT @@session.protocol_version;
+ERROR HY000: Variable 'protocol_version' is a GLOBAL variable
+SELECT @@global.protocol_version;
+@@global.protocol_version
+10
+SET @@session.protocol_version= 7;
+ERROR HY000: Variable 'protocol_version' is a read only variable
+SET @@global.protocol_version= 7;
+ERROR HY000: Variable 'protocol_version' is a read only variable
+#
+SHOW VARIABLES like 'skip_external_locking';
+Variable_name Value
+skip_external_locking ON
+SELECT @@session.skip_external_locking;
+ERROR HY000: Variable 'skip_external_locking' is a GLOBAL variable
+SELECT @@global.skip_external_locking;
+@@global.skip_external_locking
+1
+SET @@session.skip_external_locking= true;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
+SET @@global.skip_external_locking= true;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
+#
+SHOW VARIABLES like 'skip_networking';
+Variable_name Value
+skip_networking OFF
+SELECT @@session.skip_networking;
+ERROR HY000: Variable 'skip_networking' is a GLOBAL variable
+SELECT @@global.skip_networking;
+@@global.skip_networking
+0
+SET @@session.skip_networking= true;
+ERROR HY000: Variable 'skip_networking' is a read only variable
+SET @@global.skip_networking= true;
+ERROR HY000: Variable 'skip_networking' is a read only variable
+#
+SHOW VARIABLES like 'skip_show_database';
+Variable_name Value
+skip_show_database OFF
+SELECT @@session.skip_show_database;
+ERROR HY000: Variable 'skip_show_database' is a GLOBAL variable
+SELECT @@global.skip_show_database;
+@@global.skip_show_database
+0
+SET @@session.skip_show_database= true;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
+SET @@global.skip_show_database= true;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
+#
+SHOW VARIABLES like 'thread_stack';
+Variable_name Value
+thread_stack #
+SELECT @@session.thread_stack;
+ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
+SELECT @@global.thread_stack;
+@@global.thread_stack
+#
+SET @@session.thread_stack= 7;
+ERROR HY000: Variable 'thread_stack' is a read only variable
+SET @@global.thread_stack= 7;
+ERROR HY000: Variable 'thread_stack' is a read only variable
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index a0af9fdcf1d..2fefa21eaca 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -625,7 +625,7 @@ drop table t1;
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
select b from v1 use index (some_index) where b=1;
-ERROR HY000: Incorrect usage of index hints and VIEW
+ERROR 42000: Key 'some_index' doesn't exist in table 'v1'
drop view v1;
drop table t1;
create table t1 (col1 char(5),col2 char(5));
@@ -3562,11 +3562,11 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1 USE KEY(non_existant);
-ERROR HY000: Incorrect usage of index hints and VIEW
+ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
SELECT * FROM v1 FORCE KEY(non_existant);
-ERROR HY000: Incorrect usage of index hints and VIEW
+ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
SELECT * FROM v1 IGNORE KEY(non_existant);
-ERROR HY000: Incorrect usage of index hints and VIEW
+ERROR 42000: Key 'non_existant' doesn't exist in table 'v1'
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0,
@@ -3672,6 +3672,33 @@ DROP VIEW v1;
# -- End of test case for Bug#35193.
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2));
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2;
+c1 c2
+2 2
+SELECT * FROM t1 USE INDEX (c2) WHERE c2=2;
+c1 c2
+2 2
+CREATE VIEW v1 AS SELECT c1, c2 FROM t1;
+SHOW INDEX FROM v1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2;
+ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
+SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2;
+ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
+SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2;
+ERROR 42000: Key 'PRIMARY' doesn't exist in table 'v1'
+SELECT * FROM v1 USE INDEX (c2) WHERE c2=2;
+ERROR 42000: Key 'c2' doesn't exist in table 'v1'
+SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2;
+ERROR 42000: Key 'c2' doesn't exist in table 'v1'
+SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
+ERROR 42000: Key 'c2' doesn't exist in table 'v1'
+DROP VIEW v1;
+DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/r/wait_timeout_func.result b/mysql-test/r/wait_timeout_func.result
index 35fe10a1889..01b4a71df87 100644
--- a/mysql-test/r/wait_timeout_func.result
+++ b/mysql-test/r/wait_timeout_func.result
@@ -1,30 +1,32 @@
-drop table if exists t1;
-## Creating new table t1 ##
-CREATE TABLE t1
-(
-id INT NOT NULL auto_increment,
-PRIMARY KEY (id),
-name VARCHAR(30)
-);
+SET @start_value= @@global.wait_timeout;
'#--------------------FN_DYNVARS_186_01-------------------------#'
-## Creating new connection test_con1 ##
-## Setting value of variable to 5 ##
-SET @@session.wait_timeout = 5;
-## Inserting record in table t1 ##
-INSERT into t1(name) values('Record_1');
-## Using sleep to check timeout ##
-'#--------------------FN_DYNVARS_186_02-------------------------#'
-## Setting value of variable ##
-SET @@global.wait_timeout = 5;
-## Creating new connection test_con2 ##
-INSERT into t1(name) values('Record_2');
-## Using sleep to check timeout ##
+SET @start_time= UNIX_TIMESTAMP();
+connect (test_con1, localhost, root,,);
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
+Expect 1
+1
+SET @@session.wait_timeout = <session_value>;
+connect (test_con2, localhost, root,,);
+SET @@session.wait_timeout = <session_value> - 1;
+connection default;
+wait until connections ready
+SELECT info FROM information_schema.processlist;
+info
+SELECT info FROM information_schema.processlist
'#--------------------FN_DYNVARS_186_03-------------------------#'
-## Setting value of variable to 1 ##
-SET @@global.wait_timeout = 1;
-## Creating new connection ##
-INSERT into t1(name) values('Record_3');
-## Using sleep to check timeout ##
-## We cannot test it further because the server stops due to wait_timeout ##
-SELECT * from t1;
-ERROR HY000: MySQL server has gone away
+SET @@global.wait_timeout= <global_value>;
+SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
+Expect 1
+1
+connect (test_con3, localhost, root,,);
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
+Expect 1
+1
+connection default;
+SELECT info FROM information_schema.processlist;
+info
+SELECT info FROM information_schema.processlist
+SELECT UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;;
+UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;
+1
+SET @@global.wait_timeout= @start_value;
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/std_data/Moscow_leap b/mysql-test/std_data/Moscow_leap
index 4994c005595..3e73923cfb3 100644
--- a/mysql-test/std_data/Moscow_leap
+++ b/mysql-test/std_data/Moscow_leap
Binary files differ
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/datadict/is_tables.inc b/mysql-test/suite/funcs_1/datadict/is_tables.inc
index 6d47c33e715..d1e4608a572 100644
--- a/mysql-test/suite/funcs_1/datadict/is_tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_tables.inc
@@ -346,6 +346,7 @@ WHERE table_name = 't1_my_tablex';
# Enforce a time difference bigger than the smallest unit (1 second).
--real_sleep 1.1
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
+FLUSH TABLES;
SELECT UPDATE_TIME > @UPDATE_TIME
AS "Is current UPDATE_TIME bigger than before last INSERT?"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/innodb_storedproc.result
deleted file mode 100644
index 04c1a45e67e..00000000000
--- a/mysql-test/suite/funcs_1/r/innodb_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/is_character_sets.result b/mysql-test/suite/funcs_1/r/is_character_sets.result
index 4c24a4a829a..2aaa1985020 100644
--- a/mysql-test/suite/funcs_1/r/is_character_sets.result
+++ b/mysql-test/suite/funcs_1/r/is_character_sets.result
@@ -28,22 +28,22 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.CHARACTER_SETS;
Field Type Null Key Default Extra
-CHARACTER_SET_NAME varchar(64) NO
-DEFAULT_COLLATE_NAME varchar(64) NO
+CHARACTER_SET_NAME varchar(32) NO
+DEFAULT_COLLATE_NAME varchar(32) NO
DESCRIPTION varchar(60) NO
MAXLEN bigint(3) NO 0
SHOW CREATE TABLE information_schema.CHARACTER_SETS;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.CHARACTER_SETS;
Field Type Null Key Default Extra
-CHARACTER_SET_NAME varchar(64) NO
-DEFAULT_COLLATE_NAME varchar(64) NO
+CHARACTER_SET_NAME varchar(32) NO
+DEFAULT_COLLATE_NAME varchar(32) NO
DESCRIPTION varchar(60) NO
MAXLEN bigint(3) NO 0
# Testcases 3.2.2.2 and 3.2.2.3 are checked in suite/funcs_1/t/charset_collation*.test
diff --git a/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result b/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result
index 43dc14784f4..7eba964bdf6 100644
--- a/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result
+++ b/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result
@@ -28,18 +28,18 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Field Type Null Key Default Extra
-COLLATION_NAME varchar(64) NO
-CHARACTER_SET_NAME varchar(64) NO
+COLLATION_NAME varchar(32) NO
+CHARACTER_SET_NAME varchar(32) NO
SHOW CREATE TABLE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Table Create Table
COLLATION_CHARACTER_SET_APPLICABILITY CREATE TEMPORARY TABLE `COLLATION_CHARACTER_SET_APPLICABILITY` (
- `COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT ''
+ `COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Field Type Null Key Default Extra
-COLLATION_NAME varchar(64) NO
-CHARACTER_SET_NAME varchar(64) NO
+COLLATION_NAME varchar(32) NO
+CHARACTER_SET_NAME varchar(32) NO
# Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
diff --git a/mysql-test/suite/funcs_1/r/is_collations.result b/mysql-test/suite/funcs_1/r/is_collations.result
index ca9259b67eb..234aeff8ff2 100644
--- a/mysql-test/suite/funcs_1/r/is_collations.result
+++ b/mysql-test/suite/funcs_1/r/is_collations.result
@@ -28,8 +28,8 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.COLLATIONS;
Field Type Null Key Default Extra
-COLLATION_NAME varchar(64) NO
-CHARACTER_SET_NAME varchar(64) NO
+COLLATION_NAME varchar(32) NO
+CHARACTER_SET_NAME varchar(32) NO
ID bigint(11) NO 0
IS_DEFAULT varchar(3) NO
IS_COMPILED varchar(3) NO
@@ -37,8 +37,8 @@ SORTLEN bigint(3) NO 0
SHOW CREATE TABLE information_schema.COLLATIONS;
Table Create Table
COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
- `COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
- `CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
+ `COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
+ `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`ID` bigint(11) NOT NULL DEFAULT '0',
`IS_DEFAULT` varchar(3) NOT NULL DEFAULT '',
`IS_COMPILED` varchar(3) NOT NULL DEFAULT '',
@@ -46,8 +46,8 @@ COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLLATIONS;
Field Type Null Key Default Extra
-COLLATION_NAME varchar(64) NO
-CHARACTER_SET_NAME varchar(64) NO
+COLLATION_NAME varchar(32) NO
+CHARACTER_SET_NAME varchar(32) NO
ID bigint(11) NO 0
IS_DEFAULT varchar(3) NO
IS_COMPILED varchar(3) NO
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index 99a497d806d..e0780a60e2e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -40,8 +40,8 @@ CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL
CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL
NUMERIC_PRECISION bigint(21) unsigned YES NULL
NUMERIC_SCALE bigint(21) unsigned YES NULL
-CHARACTER_SET_NAME varchar(64) YES NULL
-COLLATION_NAME varchar(64) YES NULL
+CHARACTER_SET_NAME varchar(32) YES NULL
+COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
@@ -62,8 +62,8 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
`CHARACTER_OCTET_LENGTH` bigint(21) unsigned DEFAULT NULL,
`NUMERIC_PRECISION` bigint(21) unsigned DEFAULT NULL,
`NUMERIC_SCALE` bigint(21) unsigned DEFAULT NULL,
- `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
- `COLLATION_NAME` varchar(64) DEFAULT NULL,
+ `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL,
+ `COLLATION_NAME` varchar(32) DEFAULT NULL,
`COLUMN_TYPE` longtext NOT NULL,
`COLUMN_KEY` varchar(3) NOT NULL DEFAULT '',
`EXTRA` varchar(27) NOT NULL DEFAULT '',
@@ -84,8 +84,8 @@ CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL
CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL
NUMERIC_PRECISION bigint(21) unsigned YES NULL
NUMERIC_SCALE bigint(21) unsigned YES NULL
-CHARACTER_SET_NAME varchar(64) YES NULL
-COLLATION_NAME varchar(64) YES NULL
+CHARACTER_SET_NAME varchar(32) YES NULL
+COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
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..15466887ecc 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -3,22 +3,22 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME 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
-NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60) select
NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) select
NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
@@ -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
@@ -110,9 +110,9 @@ NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NUL
NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -200,11 +200,11 @@ NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
@@ -213,9 +213,9 @@ NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NU
NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
NULL information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) select
NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -244,7 +244,7 @@ NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NU
NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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
@@ -357,18 +357,18 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
-3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
-3.0000 information_schema COLLATIONS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLLATIONS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
-3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema COLUMNS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema COLUMNS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema COLUMNS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -381,8 +381,8 @@ NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH bigint NULL NULL NULL N
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema COLUMNS NUMERIC_PRECISION bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema COLUMNS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema COLUMNS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27)
@@ -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)
@@ -464,9 +464,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -550,7 +550,7 @@ NULL information_schema PROCESSLIST TIME bigint NULL NULL NULL NULL bigint(7)
3.0000 information_schema ROUTINES SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
-1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
@@ -558,8 +558,8 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
@@ -567,9 +567,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -602,7 +602,7 @@ NULL information_schema TABLES AUTO_INCREMENT bigint NULL NULL NULL NULL bigint(
NULL information_schema TABLES CREATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
-3.0000 information_schema TABLES TABLE_COLLATION varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
@@ -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 52673f1d285..6dfe5899bf4 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_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index ba564c42f91..e7a900f5c0b 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -45,7 +45,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
-SQL_MODE longtext NO NULL
+SQL_MODE varchar(8192) NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
@@ -71,7 +71,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
`CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `SQL_MODE` longtext NOT NULL,
+ `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
@@ -97,7 +97,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
-SQL_MODE longtext NO NULL
+SQL_MODE varchar(8192) NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result
index 33ab912efce..2850655148e 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata.result
@@ -30,24 +30,24 @@ DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
-DEFAULT_CHARACTER_SET_NAME varchar(64) NO
-DEFAULT_COLLATION_NAME varchar(64) NO
+DEFAULT_CHARACTER_SET_NAME varchar(32) NO
+DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SHOW CREATE TABLE information_schema.SCHEMATA;
Table Create Table
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
`CATALOG_NAME` varchar(512) DEFAULT NULL,
`SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
- `DEFAULT_COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
+ `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
+ `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
`SQL_PATH` varchar(512) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
-DEFAULT_CHARACTER_SET_NAME varchar(64) NO
-DEFAULT_COLLATION_NAME varchar(64) NO
+DEFAULT_CHARACTER_SET_NAME varchar(32) NO
+DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 1ed97e52c6c..1ab863b9b7d 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -45,7 +45,7 @@ AUTO_INCREMENT bigint(21) unsigned YES NULL
CREATE_TIME datetime YES NULL
UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
-TABLE_COLLATION varchar(64) YES NULL
+TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(255) YES NULL
TABLE_COMMENT varchar(80) NO
@@ -69,7 +69,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`CREATE_TIME` datetime DEFAULT NULL,
`UPDATE_TIME` datetime DEFAULT NULL,
`CHECK_TIME` datetime DEFAULT NULL,
- `TABLE_COLLATION` varchar(64) DEFAULT NULL,
+ `TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(255) DEFAULT NULL,
`TABLE_COMMENT` varchar(80) NOT NULL DEFAULT ''
@@ -93,7 +93,7 @@ AUTO_INCREMENT bigint(21) unsigned YES NULL
CREATE_TIME datetime YES NULL
UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
-TABLE_COLLATION varchar(64) YES NULL
+TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(255) YES NULL
TABLE_COMMENT varchar(80) NO
@@ -310,6 +310,7 @@ SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum
FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
+FLUSH TABLES;
SELECT UPDATE_TIME > @UPDATE_TIME
AS "Is current UPDATE_TIME bigger than before last INSERT?"
FROM information_schema.tables
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index ca62bd26e80..edf4a9e5032 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_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/ndb_storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 04c1a45e67e..38fa933e13f 100644
--- a/mysql-test/suite/funcs_1/r/ndb_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/triggers/triggers_03e_db_level.inc b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
index e3012ed0ca0..e5933eb84a8 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
@@ -185,7 +185,7 @@ let $message= use db with trigger privilege on db level and without...:;
select f1 from t1 order by f1;
--disable_warnings
disconnect no_privs;
- --enable warnings
+ --enable_warnings
connection yes_privs;
select current_user;
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_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_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_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_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_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_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/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
deleted file mode 100644
index d43704c2ba7..00000000000
--- a/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
+++ /dev/null
@@ -1,91 +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;
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 491 Query 1 556 COMMIT
-master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
-master-bin.000001 636 Query 1 712 use `test`; DROP TABLE t1
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-3 3
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 491 Query 1 556 COMMIT
-master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
-master-bin.000001 636 Query 1 712 use `test`; DROP TABLE t1
-master-bin.000001 712 Query 1 829 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 829 Query 1 893 BEGIN
-master-bin.000001 893 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 933 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 991 Write_rows 1 157 table_id: #
-master-bin.000001 1050 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 1097 Query 1 1162 COMMIT
-master-bin.000001 1162 Query 1 1226 BEGIN
-master-bin.000001 1226 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 1266 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1324 Write_rows 1 157 table_id: #
-master-bin.000001 1383 Delete_rows 1 196 table_id: # flags: STMT_END_F
-master-bin.000001 1422 Query 1 1487 COMMIT
-master-bin.000001 1487 Query 1 1563 use `test`; DROP TABLE t1
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/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result
new file mode 100644
index 00000000000..d6c57aed41b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result
@@ -0,0 +1,91 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
+master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 392 Write_rows 1 451 table_id: #
+master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
+master-bin.000001 498 Query 1 563 COMMIT
+master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
+master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+3 3
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
+master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 392 Write_rows 1 451 table_id: #
+master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
+master-bin.000001 498 Query 1 563 COMMIT
+master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
+master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
+master-bin.000001 719 Query 1 836 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 836 Query 1 900 BEGIN
+master-bin.000001 900 Table_map 1 943 table_id: # (test.t1)
+master-bin.000001 943 Table_map 1 1005 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1005 Write_rows 1 1064 table_id: #
+master-bin.000001 1064 Write_rows 1 1111 table_id: # flags: STMT_END_F
+master-bin.000001 1111 Query 1 1176 COMMIT
+master-bin.000001 1176 Query 1 1240 BEGIN
+master-bin.000001 1240 Table_map 1 1283 table_id: # (test.t1)
+master-bin.000001 1283 Table_map 1 1345 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1345 Write_rows 1 1404 table_id: #
+master-bin.000001 1404 Delete_rows 1 1443 table_id: # flags: STMT_END_F
+master-bin.000001 1443 Query 1 1508 COMMIT
+master-bin.000001 1508 Query 1 1584 use `test`; DROP TABLE t1
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt
index 01cf3e0520f..01cf3e0520f 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
index 5381dff95a3..549227db61a 100644
--- a/mysql-test/suite/rpl/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 t/rpl_truncate_7ndb.test
+--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 662f9095810..76d57e76491 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 60d98fce490..2eeca1eea90 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_filesystem-master.opt b/mysql-test/t/ctype_filesystem-master.opt
new file mode 100644
index 00000000000..44127f68664
--- /dev/null
+++ b/mysql-test/t/ctype_filesystem-master.opt
@@ -0,0 +1,2 @@
+--character-sets-dir=$MYSQL_TEST_DIR/ß
+--character-set-filesystem=latin1
diff --git a/mysql-test/t/ctype_filesystem.test b/mysql-test/t/ctype_filesystem.test
new file mode 100644
index 00000000000..2b993c2b924
--- /dev/null
+++ b/mysql-test/t/ctype_filesystem.test
@@ -0,0 +1,6 @@
+SET CHARACTER SET utf8;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+SHOW VARIABLES like 'character_sets_dir';
+SHOW VARIABLES like 'character_set_filesystem';
+SHOW VARIABLES like 'character_set_client';
+SET CHARACTER SET default;
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/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 2e23ac3661c..f0c769251cf 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1439,3 +1439,20 @@ select hex(_utf8 X'616263FF');
select hex(_utf8 B'001111111111');
--error ER_INVALID_CHARACTER_STRING
select (_utf8 X'616263FF');
+
+#
+# Bug #36772: When using UTF8, CONVERT with GROUP BY returns truncated results
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
+INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
+ALTER TABLE t1 ADD UNIQUE (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+DROP INDEX b ON t1;
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
+ALTER TABLE t1 ADD INDEX (b);
+SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index ada7cb3aa97..5de0a435ba5 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -10,8 +10,6 @@
#
##############################################################################
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
-
+wait_timeout_func : Bug #41225 joro wait_timeout_func fails
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/events_scheduling.test b/mysql-test/t/events_scheduling.test
index a5133166495..87cfa42e283 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -1,11 +1,12 @@
-# Can't test with embedded server that doesn't support grants
+# Can't test with embedded server that doesn't support events
-- source include/not_embedded.inc
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
+SET @event_scheduler=@@global.event_scheduler;
SET GLOBAL event_scheduler=OFF;
---echo Try agian to make sure it's allowed
+--echo Try again to make sure it's allowed
SET GLOBAL event_scheduler=OFF;
SHOW VARIABLES LIKE 'event_scheduler';
SET GLOBAL event_scheduler=1;
@@ -57,34 +58,44 @@ ON COMPLETION PRESERVE
DO
INSERT INTO table_4 VALUES (1);
+# Wait for the events to fire and check the data afterwards
+
# Let event_1 insert at least 4 records into the table
let $wait_condition=select count(*) >= 4 from table_1;
--source include/wait_condition.inc
+# Minimum of passed time is 6 seconds assuming
+# - event executions starts immediate after creation
+# - 4 times event_1 means an insert at ect, ect+2, ect+4, ect+6
+# ect = event creation time
-# Let event_2 reach the end of its execution interval
+# Let event_2 reach the end of its execution interval
let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_2' and status='enabled';
--source include/wait_condition.inc
+# Minimum of passed time is 6 seconds.
+# See wait_condition for event_1 above and ENDS condition for event_2.
-# Let event_3, which is ON COMPLETION NOT PRESERVE execute and drop itself
+# Let event_3, which is ON COMPLETION NOT PRESERVE execute and drop itself
let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_3';
--source include/wait_condition.inc
-# Let event_4 reach the end of its execution interval
+# Let event_4 reach the end of its execution interval
let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_4' and status='enabled';
--source include/wait_condition.inc
-# Wait for the events to fire and check the data afterwards
-
let $wait_condition=SELECT SUM(a) >= 4 FROM table_1;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
-let $wait_condition=SELECT SUM(a) >= 5 FROM table_2;
+# In case of a testing box under heavy load it cannot be guaranteed that
+# it is really often enough checked if event_2 has to be executed.
+# -> Bug#39854 events_scheduling fails sporadically on pushbuild
+# Therefore we lowered here the original expectation of 5 to 4.
+let $wait_condition=SELECT SUM(a) >= 4 FROM table_2;
source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
+SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
source include/wait_condition.inc;
@@ -112,9 +123,9 @@ DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
DROP DATABASE events_test;
-SET GLOBAL event_scheduler=OFF;
+SET GLOBAL event_scheduler=@event_scheduler;
-#
+#
# End of tests
#
diff --git a/mysql-test/t/events_time_zone.test b/mysql-test/t/events_time_zone.test
index af3466a339c..ccae7847618 100644
--- a/mysql-test/t/events_time_zone.test
+++ b/mysql-test/t/events_time_zone.test
@@ -1,11 +1,40 @@
-# This test case is sensitive to execution timing. You may control
-# this sensitivity by the parameter below. Small values will result
-# in fast but more unstable execution, large values will improve
-# stability at the cost of speed. Basically, N is a number of seconds
-# to wait for operation to complete. Should be positive. Test runs
-# about 25*N seconds (it sleeps most of the time, so CPU speed is not
-# relevant).
+# 1. This test case is sensitive to execution timing. You may control
+# this sensitivity by the parameter below. Small values will result
+# in fast but more unstable execution, large values will improve
+# stability at the cost of speed. Basically, N is a number of seconds
+# to wait for operation to complete. Should be positive. Test runs
+# about 25*N seconds (it sleeps most of the time, so CPU speed is not
+# relevant).
let $N = 5;
+#
+# 2. Some subtests
+# - create a new time zone
+# - run some statements
+# - delete the new time zone.
+# But the time zone name used gets somewhere cached and it cannot be
+# "reused" later in the same or another session for a new time zone.
+# Experiments (2008-11 MySQL 5.1) showed that none of the available
+# RESET/FLUSH commands removes these entries.
+# 2008-11 MySQL 5.1 Bug#39979 main.events_time_zone does not clean up
+# second bad effect
+# Therefore we compute unique and unusual timezone names to minimize
+# the likelihood that a later test uses the same name.
+#
+# 3. The subtests mentioned in 2. cause that the AUTO_INCREMENT value
+# within "SHOW CREATE TABLE mysql.timezone" differ from the initial one.
+# (Bug#39979 main.events_time_zone does not clean up)
+# Therefore we reset this value after each of these subtests.
+#
+# Note(mleich):
+# There is a significant likelihood that future improvements of the server
+# cause that the solutions for the issues mentioned in 2. and 3. will no
+# more work.
+# A mysql-test-run.pl feature which allows to enforce
+# 1. Server shutdown (-> Problem mentioned in 2. disappears)
+# 2. Reset all data to initial state (-> Problem mentioned in 3. disappears)
+# 3. Server start
+# after a tests would be a perfect replacement.
+#
--source include/big_test.inc
@@ -73,19 +102,15 @@ delimiter ;//
SET @step3= @step * 3;
SET @step6= @step * 6;
-# Disable query log to hide current time.
---disable_query_log
SET @unix_time= UNIX_TIMESTAMP() - 1;
---enable_query_log
-
SET @unix_time= @unix_time - @unix_time % @step6;
INSERT INTO mysql.time_zone VALUES (NULL, 'N');
SET @tzid= LAST_INSERT_ID();
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 0, 0, 0, 'b16420_0');
+ VALUES (@tzid, 0, 0, 0, 'b16420_0');
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
+ VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1');
let $transition_unix_time= `SELECT @unix_time`;
let $count= 30;
@@ -99,7 +124,9 @@ while ($count)
dec $count;
}
--enable_query_log
-INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid);
+let $tz_name = `SELECT CONCAT('b16420_a',UNIX_TIMESTAMP())`;
+--replace_result $tz_name <TZ_NAME_1>
+eval INSERT INTO mysql.time_zone_name VALUES ('$tz_name', @tzid);
CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80));
CREATE TABLE t2 (count INT);
@@ -135,7 +162,8 @@ SET TIME_ZONE= '+00:00';
CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e1>");
-SET TIME_ZONE= 'bug16420';
+--replace_result $tz_name <TZ_NAME_1>
+eval SET TIME_ZONE= '$tz_name';
CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND
STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1("<e2>");
@@ -196,6 +224,8 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
+let $time_zone_auto_inc = `SELECT MAX(Time_zone_id) + 1 FROM mysql.time_zone`;
+eval ALTER TABLE mysql.time_zone AUTO_INCREMENT = $time_zone_auto_inc;
#----------------------------------------------------------------------
@@ -216,13 +246,13 @@ SET @offset_month_03= UNIX_TIMESTAMP('2030-03-31 12:00:00') - @now - 5*@step;
SET @offset_month_04= UNIX_TIMESTAMP('2030-04-30 12:00:00') - @now - 13*@step;
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0');
+ VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0');
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1');
+ VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1');
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2');
+ VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2');
INSERT INTO mysql.time_zone_transition_type
- VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3');
+ VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3');
INSERT INTO mysql.time_zone_transition
VALUES (@tzid, @now, 0);
INSERT INTO mysql.time_zone_transition
@@ -231,11 +261,12 @@ INSERT INTO mysql.time_zone_transition
VALUES (@tzid, @now + 7 * @step, 2);
INSERT INTO mysql.time_zone_transition
VALUES (@tzid, @now + 12 * @step, 3);
-# We have to user a new time zone name, because 'bug16420' has been
-# cached already.
-INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid);
+let $tz_name = `SELECT CONCAT('b16420_b',UNIX_TIMESTAMP())`;
+--replace_result $tz_name <TZ_NAME_2>
+eval INSERT INTO mysql.time_zone_name VALUES ('$tz_name', @tzid);
-SET TIME_ZONE= 'bug16420_2';
+--replace_result $tz_name <TZ_NAME_2>
+eval SET TIME_ZONE= '$tz_name';
SET GLOBAL EVENT_SCHEDULER= ON;
@@ -280,6 +311,8 @@ DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid;
DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid;
+let $time_zone_auto_inc = `SELECT MAX(Time_zone_id) + 1 FROM mysql.time_zone`;
+eval ALTER TABLE mysql.time_zone AUTO_INCREMENT = $time_zone_auto_inc;
DROP FUNCTION round_to_step;
DROP TABLE t_step;
@@ -291,8 +324,8 @@ eval USE $old_db;
--enable_query_log
let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where db='mysqltest_db1' and command = 'Connect' and user=current_user();
+ SELECT COUNT(*) = 0 FROM information_schema.processlist
+ WHERE db='mysqltest_db1' AND command = 'Connect' AND user=current_user();
--source include/wait_condition.inc
--echo End of 5.1 tests.
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..f45bff2597f 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;
@@ -1876,6 +1923,25 @@ DROP TABLE t1;
connection master;
DROP TABLE t1;
+
+#
+# Bug #34774 key prefix on text field in federated tables can cause
+# server to crash!
+#
+connection slave;
+CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
+INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE t1
+ (a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
+SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
+connection slave;
+DROP TABLE t1;
+connection master;
+DROP TABLE t1;
+
connection default;
--echo End of 5.0 tests
@@ -1884,4 +1950,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/federated_innodb.test b/mysql-test/t/federated_innodb.test
index 772e37a2929..0617cb15d97 100644
--- a/mysql-test/t/federated_innodb.test
+++ b/mysql-test/t/federated_innodb.test
@@ -1,5 +1,10 @@
-source include/federated.inc;
+# NOTE: Keep any include/ files that will kill / skip a test BEFORE any others
+# having federated.inc before have_innodb.inc allows for an orphaned database
+# that can cause other tests to fail.
+# See Bug #40645 Test main.federated_innodb does not always clean up after itself
+
source include/have_innodb.inc;
+source include/federated.inc;
#
# Bug#25513 Federated transaction failures
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 64f77b4f0b7..21b06ca0882 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -418,3 +418,30 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
DROP TABLE t1;
# End of 4.1 tests
+
+#
+# BUG#38842 - Fix for 25951 seems incorrect
+#
+CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
+INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
+ ('test', 1),('test', 2),('test', 3),('test', 4);
+
+EXPLAIN SELECT * FROM t1
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+EXPLAIN SELECT * FROM t1 USE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+EXPLAIN SELECT * FROM t1 USE INDEX(b)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
+WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index 68f07f258bf..7f17fd2180f 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -43,8 +43,11 @@ drop table t1;
# note that when LOW_MEMORY is set the "test" below is meaningless
#
-set @@max_allowed_packet=1048576*100;
+set @@global.max_allowed_packet=1048576*100;
--replace_result "''" XXX "'1'" XXX
+
+# reconnect to make the new max packet size take effect
+--connect (newconn, localhost, root,,)
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
#
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index b6143bc0c78..be4e9c32686 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -933,5 +933,74 @@ 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;
+
+#
+# Bug #39656: Behaviour different for agg functions with & without where -
+# ONLY_FULL_GROUP_BY
+#
+
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
+
+SET SQL_MODE='ONLY_FULL_GROUP_BY';
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t1 where a=1;
+
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+SELECT COUNT(*),a FROM t1;
+
+SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
+
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
+ FROM t1 outr;
+
+SELECT COUNT(*) FROM t1 a JOIN t1 outr
+ ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
+
+SET SQL_MODE=default;
+DROP TABLE t1;
+
+
###
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index 5db6db70e8f..f37ee0c39f0 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -135,3 +135,20 @@ select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
--enable_ps_protocol
# End of 4.1 tests
+
+
+
+#
+# Bug#37553: MySql Error Compare TimeDiff & Time
+#
+
+# calculations involving negative time values ignored sign
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00');
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00');
+select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
+
+# show that conversion to DECIMAL no longer drops sign
+SELECT CAST(time('-73:42:12') AS DECIMAL);
+
+
+# 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/group_concat_max_len_func.test b/mysql-test/t/group_concat_max_len_func.test
index d1dc8df43a0..29a4ff5becb 100644
--- a/mysql-test/t/group_concat_max_len_func.test
+++ b/mysql-test/t/group_concat_max_len_func.test
@@ -11,18 +11,23 @@
# Creation Date: 2008-03-07 #
# Author: Salman Rawala #
# #
+# Last modification: #
+# 2008-11-14 mleich Fix Bug#40644 main.group_concat_max_len_func random #
+# failures #
+# + minor improvements #
+# #
# Description: Test Cases of Dynamic System Variable group_concat_max_len #
# that checks the functionality of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
SET @save = @@global.group_concat_max_len;
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
#########################
@@ -32,34 +37,38 @@ drop table if exists t1;
--echo ## Creating new table t1 ##
CREATE TABLE t1
(
-id INT NOT NULL auto_increment,
+id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
-rollno int NOT NULL,
+rollno INT NOT NULL,
name VARCHAR(30)
);
--echo '#--------------------FN_DYNVARS_034_01-------------------------#'
########################################################################
# Setting initial value of group_concat_max_len, inserting some rows
-# & creating 2 new connections
+# & creating 2 new connections
########################################################################
---echo ## Setting initial value of variable to 4 ##
+--echo ## Setting initial value of variable to 4 ##
SET @@global.group_concat_max_len = 4;
---echo ## Inserting some rows in table ##
-INSERT into t1(rollno, name) values(1, 'Record_1');
-INSERT into t1(rollno, name) values(2, 'Record_2');
-INSERT into t1(rollno, name) values(1, 'Record_3');
-INSERT into t1(rollno, name) values(3, 'Record_4');
-INSERT into t1(rollno, name) values(1, 'Record_5');
-INSERT into t1(rollno, name) values(3, 'Record_6');
-INSERT into t1(rollno, name) values(4, 'Record_7');
-INSERT into t1(rollno, name) values(4, 'Record_8');
-
---echo ## Creating two new connections ##
-CONNECT (test_con1,localhost,root,,);
-CONNECT (test_con2,localhost,root,,);
+--echo ## Inserting some rows in table ##
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_1');
+INSERT INTO t1(rollno, name) VALUES(2, 'Record_2');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_3');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_4');
+INSERT INTO t1(rollno, name) VALUES(1, 'Record_5');
+INSERT INTO t1(rollno, name) VALUES(3, 'Record_6');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_7');
+INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
+# The following "auxiliary" select ensures that all records are on disk
+# = result sets got by parallel sessions cannot suffer from effects
+# caused by the MyISAM feature "concurrent_inserts".
+SELECT * FROM t1 ORDER BY id;
+
+--echo ## Creating two new connections ##
+connect (test_con1,localhost,root,,);
+connect (test_con2,localhost,root,,);
--echo '#--------------------FN_DYNVARS_034_02-------------------------#'
@@ -68,16 +77,16 @@ CONNECT (test_con2,localhost,root,,);
###############################################################################
--echo ## Connecting with test_con1 ##
-CONNECTION test_con1;
+connection test_con1;
---echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
+--echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
--echo ## Changing session value of variable and verifying its behavior, ##
---echo ## warning should come here ##
+--echo ## warning should come here ##
SET @@session.group_concat_max_len = 10;
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
--echo '#--------------------FN_DYNVARS_034_03-------------------------#'
@@ -85,19 +94,19 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
# Verifying behavior of variable by increasing session value of variable #
##############################################################################
---echo ## Connecting with new connection test_con2 ##
+--echo ## Connecting with new connection test_con2 ##
connection test_con2;
---echo ## Verifying initial value of variable. It should be 4 ##
+--echo ## Verifying initial value of variable. It should be 4 ##
SELECT @@session.group_concat_max_len = 4;
---echo ## Setting session value of variable to 20 and verifying variable is concating ##
---echo ## column's value to 20 or not ##
+--echo ## Setting session value of variable to 20 and verifying variable is concating ##
+--echo ## column's value to 20 or not ##
SET @@session.group_concat_max_len = 20;
--echo ## Verifying value of name column, it should not me more than 20 characters ##
--echo ## Warning should come here ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
--echo '#--------------------FN_DYNVARS_034_04-------------------------#'
@@ -106,12 +115,12 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
# greater than the maximum concat length of name column #
###############################################################################
---echo ## Setting session value of variable to 26. No warning should appear here ##
---echo ## because the value after concatination is less than 30 ##
+--echo ## Setting session value of variable to 26. No warning should appear here ##
+--echo ## because the value after concatination is less than 30 ##
SET @@session.group_concat_max_len = 26;
---echo ## Verifying value of name column, it should not give warning now ##
-SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
+--echo ## Verifying value of name column, it should not give warning now ##
+SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
############################################################
@@ -119,11 +128,11 @@ SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
############################################################
--echo ## Dropping table t1 ##
-DROP table t1;
+DROP TABLE t1;
--echo ## Disconnecting both the connection ##
-DISCONNECT test_con2;
-DISCONNECT test_con1;
+disconnect test_con2;
+disconnect test_con1;
connection default;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index bb9cb127d07..bcb22c44076 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1338,4 +1338,49 @@ 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;
+
+#
+# Bug#39955 SELECT on INFORMATION_SCHEMA.GLOBAL_VARIABLES takes too long
+#
+set global init_connect="drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;\
+drop table if exists t1;drop table if exists t1;";
+select * from information_schema.global_variables where variable_name='init_connect';
+set global init_connect="";
+
+#
+# Bug #34517 SHOW GLOBAL STATUS does not work properly in embedded server.
+#
+
+create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
+SELECT 1;
+select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_status a
+ where a.VARIABLE_NAME = b.VARIABLE_NAME;
+drop table t0;
+
--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/information_schema_part.test b/mysql-test/t/information_schema_part.test
index 4cbf21ca1d3..f1415d12f79 100644
--- a/mysql-test/t/information_schema_part.test
+++ b/mysql-test/t/information_schema_part.test
@@ -121,3 +121,13 @@ SHOW CREATE TABLE t1;
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
drop table t1;
+
+#
+# Bug#38909 CREATE_OPTIONS in information_schema produces wrong results
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (f1 int key) partition by key(f1) partitions 2;
+select create_options from information_schema.tables where table_schema="test";
+drop table t1;
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_bug34300.test b/mysql-test/t/innodb_bug34300.test
index 4b4a3fdc8a3..114bcf98c25 100644
--- a/mysql-test/t/innodb_bug34300.test
+++ b/mysql-test/t/innodb_bug34300.test
@@ -8,7 +8,9 @@
-- disable_query_log
-- disable_result_log
-SET @@max_allowed_packet=16777216;
+# set packet size and reconnect
+SET @@global.max_allowed_packet=16777216;
+--connect (newconn, localhost, root,,)
DROP TABLE IF EXISTS bug34300;
CREATE TABLE bug34300 (
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index bcdb1328cb7..d47406697f8 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -29,3 +29,27 @@ 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;
+
+#
+# Bug#37284 Crash in Field_string::type()
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
+CREATE INDEX i1 on t1 (a(3));
+SELECT * FROM t1 WHERE a = 'abcde';
+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_output_func.test b/mysql-test/t/log_output_func.test
index 32026d8de59..007c4f38659 100644
--- a/mysql-test/t/log_output_func.test
+++ b/mysql-test/t/log_output_func.test
@@ -10,12 +10,13 @@
# #
# Creation Date: 2008-03-08 #
# Author: Rizwan #
+# Modified: HHunger 2008-08-29
# #
# Description: Test Cases of Dynamic System Variable log_output #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -23,6 +24,10 @@
# ps-protocol. So, it is switched off.
--disable_ps_protocol
+SET @start_value= @@global.log_output;
+SET @start_general_log= @@global.general_log;
+SET @start_general_log_file= @@global.general_log_file;
+
--echo '#--------------------FN_DYNVARS_065_01-------------------------#'
##################################################################
# Check if setting log_output is changed in every new connection #
@@ -32,17 +37,12 @@ SET @@global.log_output = 'NONE';
# con1 will be default connection from now on
--echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
-connection con1;
-SELECT @@global.log_output;
SET @@global.log_output = 'TABLE,FILE';
+
+# Test that the effect is global
--echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
-connection con2;
SELECT @@global.log_output;
-disconnect con2;
-
--echo '#--------------------FN_DYNVARS_065_02-------------------------#'
####################################################
@@ -52,10 +52,9 @@ disconnect con2;
--echo 'connection con1'
connection con1;
-
-#=======================================================================
+#===============================================================
--echo '---Checking general_log when log_output is NONE---'
-#=======================================================================
+#===============================================================
SET @@global.log_output = 'NONE';
TRUNCATE TABLE mysql.general_log;
@@ -64,13 +63,13 @@ TRUNCATE TABLE mysql.general_log;
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1(a INT);
-INSERT INTO t1 value(1);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
SELECT count(*) FROM mysql.general_log;
-#==============================================================================
+#===============================================================
--echo '---Checking general_log when log_output is TABLE---'
-#==============================================================================
+#===============================================================
SET @@global.log_output = 'TABLE';
TRUNCATE TABLE mysql.general_log;
@@ -78,35 +77,49 @@ TRUNCATE TABLE mysql.general_log;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-create table t1(a int);
-INSERT INTO t1 value(1);
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
-SELECT count(*) from mysql.general_log;
+# At least the last 4 statement should be logged.
+SELECT count(*)>4 FROM mysql.general_log;
-#===========================================================
+#===============================================================
# Checking general_log when log_output is FILE
-#===========================================================
-
-#SET @log_file = "mytest.log";
-#SET @@global.general_log = 0;
-#FLUSH LOGS;
-#SET @@global.general_log_file = @log_file;
---echo 'Bug#35371: Changing general_log file is crashing server'
---echo 'SET @@global.general_log_file = @log_file;'
+#===============================================================
+SET @@global.general_log = 'OFF';
+FLUSH LOGS;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SET @@global.general_log_file = '$MYSQLTEST_VARDIR/run/mytest.log';
+SET @@global.general_log = 'ON';
SET @@global.log_output = 'FILE';
TRUNCATE TABLE mysql.general_log;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-create table t1(a int);
-INSERT INTO t1 value(1);
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUE(1);
SELECT 'abc';
-SELECT count(*) from mysql.general_log;
+SELECT count(*) FROM mysql.general_log;
DROP TABLE t1;
+file_exists $MYSQLTEST_VARDIR/run/mytest.log ;
+
+#==============================================================
+# Clean up
+#==============================================================
+
+--echo connection default;
+connection default;
+SET @@global.general_log= 'OFF';
+SET @@global.general_log_file= @start_general_log_file;
+SET @@global.log_output= @start_value;
+SET @@global.general_log= @start_general_log;
+SET @@global.general_log= 'ON';
+
--enable_ps_protocol
####################################################
-# Endo of functionality Testing for log_output #
+# End of functionality Testing for log_output #
####################################################
+
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/max_allowed_packet_basic.test b/mysql-test/t/max_allowed_packet_basic.test
index beb9b62d6de..8be0e5f670e 100644
--- a/mysql-test/t/max_allowed_packet_basic.test
+++ b/mysql-test/t/max_allowed_packet_basic.test
@@ -36,8 +36,13 @@
SET @start_global_value = @@global.max_allowed_packet;
SELECT @start_global_value;
-SET @start_session_value = @@session.max_allowed_packet;
-SELECT @start_session_value;
+
+# give a known value to @@session.max_allowed_packet by assigning to
+# @@global and setting up a new connection (for deterministic result
+# file diffing)
+SET @@global.max_allowed_packet = DEFAULT;
+connect (conn1, localhost, root,,);
+
--echo '#--------------------FN_DYNVARS_070_01-------------------------#'
@@ -49,7 +54,9 @@ SET @@global.max_allowed_packet = 1000;
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 20000;
+--Error ER_NO_DEFAULT
SET @@session.max_allowed_packet = DEFAULT;
SELECT @@session.max_allowed_packet;
@@ -62,9 +69,6 @@ SELECT @@session.max_allowed_packet;
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet = 1048576;
-SET @@session.max_allowed_packet = DEFAULT;
-SELECT @@session.max_allowed_packet = 1048576;
-
--echo '#--------------------FN_DYNVARS_070_03-------------------------#'
############################################################################
@@ -86,14 +90,19 @@ SELECT @@global.max_allowed_packet;
# Change the value of max_allowed_packet to a valid value for SESSION Scope #
#############################################################################
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1024;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1025;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 65535;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1073741824;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1073741823;
SELECT @@session.max_allowed_packet;
@@ -118,14 +127,18 @@ SELECT @@global.max_allowed_packet;
SET @@global.max_allowed_packet = test;
SELECT @@global.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 0;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1023;
SELECT @@session.max_allowed_packet;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = -2;
SELECT @@session.max_allowed_packet;
--Error ER_PARSE_ERROR
SET @@session.max_allowed_packet = 65530.34.;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 10737418241;
SELECT @@session.max_allowed_packet;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
@@ -180,6 +193,7 @@ SELECT @@max_allowed_packet = @@global.max_allowed_packet;
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
+--Error ER_VARIABLE_IS_READONLY
SET @@max_allowed_packet = 100000;
SELECT @@max_allowed_packet = @@local.max_allowed_packet;
SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
@@ -190,6 +204,7 @@ SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
# Check if max_allowed_packet can be accessed with and without @@ sign #
#############################################################################
+--Error ER_VARIABLE_IS_READONLY
SET max_allowed_packet = 1024;
SELECT @@max_allowed_packet;
--Error ER_UNKNOWN_TABLE
@@ -204,9 +219,9 @@ SELECT max_allowed_packet = @@session.max_allowed_packet;
# Restore initial value #
####################################
+connection default;
SET @@global.max_allowed_packet = @start_global_value;
SELECT @@global.max_allowed_packet;
-SET @@session.max_allowed_packet = @start_session_value;
SELECT @@session.max_allowed_packet;
diff --git a/mysql-test/t/max_allowed_packet_func.test b/mysql-test/t/max_allowed_packet_func.test
index 37ca15f85f0..8437d480a37 100644
--- a/mysql-test/t/max_allowed_packet_func.test
+++ b/mysql-test/t/max_allowed_packet_func.test
@@ -43,26 +43,19 @@ name BLOB
--echo '#--------------------FN_DYNVARS_070_01-------------------------#'
###############################################################################
-# Setting initial value of max_allowed_packet to 1024 at session level and
-# verifying its behavior after inserting data greater than 1024 bytes
+# Setting initial value of max_allowed_packet to 1024 at session level
+# should result in an error (session variable is readonly)
###############################################################################
--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
+--error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1024;
-SET @@session.net_buffer_length = 1024;
SELECT @@session.max_allowed_packet;
-SELECT @@session.net_buffer_length;
-
---echo ## Inserting and fetching data of length greater than 1024 ##
-INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
-
-SELECT length("aaaaaasssssssssssdddddddfffffgggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk") as len;
---echo ## Verifying record in table t1 ##
-SELECT * from t1;
+--error ER_VARIABLE_IS_READONLY
+SET @@session.net_buffer_length = 1024;
+SELECT @@session.net_buffer_length;
---echo 'Bug#35381: Error is not coming on inserting and fetching data of length'
---echo 'greater than max_allowed_packet size at session level';
--echo '#--------------------FN_DYNVARS_070_02-------------------------#'
###############################################################################
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index fd1336491aa..dd3e4e28aeb 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -456,7 +456,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;
@@ -548,11 +548,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);
@@ -878,7 +878,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;
@@ -896,7 +896,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;
@@ -956,7 +956,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;
@@ -1395,6 +1395,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/multi_update.test b/mysql-test/t/multi_update.test
index 331663dceb5..0793ef15faf 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -10,9 +10,9 @@ source include/have_log_bin.inc;
drop table if exists t1,t2,t3;
drop database if exists mysqltest;
drop view if exists v1;
---error 0,1141,1147
+--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
---error 0,1141,1147
+--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
--enable_warnings
@@ -160,9 +160,9 @@ create table t2 (n int(10) not null primary key, d int(10));
insert into t1 values(1,1);
insert into t2 values(1,10),(2,20);
LOCK TABLES t1 write, t2 read;
---error 1099
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n;
---error 1099
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
unlock tables;
@@ -183,7 +183,7 @@ create table t1 (n int(10), d int(10));
create table t2 (n int(10), d int(10));
insert into t1 values(1,1);
insert into t2 values(1,10),(2,20);
---error 1175
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
set sql_safe_updates=0;
drop table t1,t2;
@@ -196,7 +196,7 @@ set timestamp=1038000000;
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
select n,d,unix_timestamp(t) from t1;
select n,d,unix_timestamp(t) from t2;
---error 1064
+--error ER_PARSE_ERROR
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
drop table t1,t2;
set timestamp=0;
@@ -324,41 +324,6 @@ delete t1, t2 from t2,t1
drop table t1,t2;
#
-# Test for bug #1820.
-#
-
-create table t1 ( a int not null, b int not null) ;
---disable_query_log
-insert into t1 values (1,1),(2,2),(3,3),(4,4);
-let $1=19;
-set @d=4;
-while ($1)
-{
- eval insert into t1 select a+@d,b+@d from t1;
- eval set @d=@d*2;
- dec $1;
-}
-
---enable_query_log
-alter table t1 add index i1(a);
-delete from t1 where a > 2000000;
-create table t2 like t1;
-insert into t2 select * from t1;
-
-select 't2 rows before small delete', count(*) from t1;
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
-select 't2 rows after small delete', count(*) from t2;
-select 't1 rows after small delete', count(*) from t1;
-
-## Try deleting many rows
-
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
-select 't2 rows after big delete', count(*) from t2;
-select 't1 rows after big delete', count(*) from t1;
-
-drop table t1,t2;
-
-#
# Test alias (this is not correct in 4.0)
#
@@ -367,7 +332,7 @@ CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
DELETE t4 FROM t1, t1 AS t4;
DELETE t3 FROM t1 AS t3, t1 AS t4;
---error 1109
+--error ER_UNKNOWN_TABLE
DELETE t1 FROM t1 AS t3, t2 AS t4;
INSERT INTO t1 values (1),(2);
INSERT INTO t2 values (1),(2);
@@ -422,7 +387,7 @@ drop database mysqltest;
create table t1 (a int, primary key (a));
create table t2 (a int, primary key (a));
create table t3 (a int, primary key (a));
--- error 1109
+-- error ER_UNKNOWN_TABLE
delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a);
drop table t1, t2, t3;
@@ -431,9 +396,9 @@ drop table t1, t2, t3;
#
create table t1 (col1 int);
create table t2 (col1 int);
--- error 1093
+-- error ER_UPDATE_TABLE_USED
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
--- error 1093
+-- error ER_UPDATE_TABLE_USED
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
drop table t1,t2;
@@ -458,7 +423,7 @@ drop table t1, t2;
#
create table t1(a int);
create table t2(a int);
---error 1093
+--error ER_UPDATE_TABLE_USED
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
drop table t1, t2;
# End of 4.1 tests
diff --git a/mysql-test/t/multi_update2-master.opt b/mysql-test/t/multi_update2-master.opt
new file mode 100644
index 00000000000..9f1a29461ff
--- /dev/null
+++ b/mysql-test/t/multi_update2-master.opt
@@ -0,0 +1 @@
+--set-variable=tmp_table_size=1024
diff --git a/mysql-test/t/multi_update2.test b/mysql-test/t/multi_update2.test
new file mode 100644
index 00000000000..47f9bc7bad7
--- /dev/null
+++ b/mysql-test/t/multi_update2.test
@@ -0,0 +1,43 @@
+#
+# Test of update statement that uses many tables.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+#
+# Bug#1820 Rows not deleted from second table on multi-table delete
+#
+
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
+--echo # The protocolling of many inserts into t1 is suppressed.
+--disable_query_log
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4);
+let $1=19;
+set @d=4;
+while ($1)
+{
+ eval INSERT INTO t1 SELECT a+@d,b+@d FROM t1;
+ eval SET @d=@d*2;
+ dec $1;
+}
+
+--enable_query_log
+ALTER TABLE t1 ADD INDEX i1(a);
+DELETE FROM t1 WHERE a > 2000000;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1;
+
+SELECT 't2 rows before small delete', COUNT(*) FROM t1;
+DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 2;
+SELECT 't2 rows after small delete', COUNT(*) FROM t2;
+SELECT 't1 rows after small delete', COUNT(*) FROM t1;
+
+## Try deleting many rows
+
+DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 100*1000;
+SELECT 't2 rows after big delete', COUNT(*) FROM t2;
+SELECT 't1 rows after big delete', COUNT(*) FROM t1;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index ba13a315cb8..0e675731fd5 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -71,6 +71,33 @@ drop table t_bug25347;
drop database d_bug25347;
use test;
+#
+# Bug#39541 CHECK TABLE on information_schema myisam tables produces error
+#
+create view v1 as select * from information_schema.routines;
+check table v1, information_schema.routines;
+drop view v1;
+
+
+#
+# Bug#37527: mysqlcheck fails to report entire database
+# when frm file corruption
+#
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+# backup then null t1.frm
+--copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+EOF
+--exec $MYSQL_CHECK test
+# restore t1.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
+DROP TABLE t1, t2;
+
+
--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 1792b11435c..8084457b92b 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/net_buffer_length_basic.test b/mysql-test/t/net_buffer_length_basic.test
index 80403bfec2b..6e1e0559c61 100644
--- a/mysql-test/t/net_buffer_length_basic.test
+++ b/mysql-test/t/net_buffer_length_basic.test
@@ -38,9 +38,13 @@
SET @start_global_value = @@global.net_buffer_length;
# Due to differences in results of linux and windows
#SELECT @start_global_value;
-SET @start_session_value = @@session.net_buffer_length;
-#SELECT @start_session_value;
+# give a known value to @@session.net_buffer_length by assigning to
+# @@global and setting up a new connection (for deterministic result
+# file diffing)
+SET @@global.net_buffer_length = DEFAULT;
+connect(con1,localhost,root,,);
+connection con1;
--echo '#--------------------FN_DYNVARS_109_01-------------------------#'
#################################################################
@@ -51,7 +55,9 @@ SET @@global.net_buffer_length = 10000;
SET @@global.net_buffer_length = DEFAULT;
SELECT @@global.net_buffer_length;
+--Error ER_VARIABLE_IS_READONLY
SET @@session.net_buffer_length = 20000;
+--Error ER_NO_DEFAULT
SET @@session.net_buffer_length = DEFAULT;
SELECT @@session.net_buffer_length;
@@ -64,9 +70,6 @@ SELECT @@session.net_buffer_length;
SET @@global.net_buffer_length = DEFAULT;
SELECT @@global.net_buffer_length = 16384;
-SET @@session.net_buffer_length = DEFAULT;
-SELECT @@session.net_buffer_length = 16384;
-
--echo '#--------------------FN_DYNVARS_109_03-------------------------#'
###########################################################################
@@ -91,17 +94,7 @@ SELECT @@global.net_buffer_length;
# Change the value of net_buffer_length to a valid value for SESSION Scope #
############################################################################
-SET @@session.net_buffer_length = 1024;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 1025;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 1048576;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 1048575;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 65535;
-SELECT @@session.net_buffer_length;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
--echo '#------------------FN_DYNVARS_109_05-----------------------#'
@@ -126,18 +119,8 @@ SELECT @@global.net_buffer_length;
SET @@global.net_buffer_length = test;
SELECT @@global.net_buffer_length;
-SET @@session.net_buffer_length = 0;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = -2;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 1048577;
-SELECT @@session.net_buffer_length;
-SET @@session.net_buffer_length = 1048576002;
-SELECT @@session.net_buffer_length;
---Error ER_PARSE_ERROR
-SET @@session.net_buffer_length = 65530.34.;
-SET @@session.net_buffer_length = 65550;
-SELECT @@session.net_buffer_length;
+# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
+
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
@@ -190,9 +173,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length;
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
-SET @@net_buffer_length = 100000;
-SELECT @@net_buffer_length = @@local.net_buffer_length;
-SELECT @@local.net_buffer_length = @@session.net_buffer_length;
+# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
--echo '#---------------------FN_DYNVARS_109_11----------------------#'
@@ -200,7 +181,7 @@ SELECT @@local.net_buffer_length = @@session.net_buffer_length;
# Check if net_buffer_length can be accessed with and without @@ sign #
############################################################################
-SET net_buffer_length = 1024;
+# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
SELECT @@net_buffer_length;
--Error ER_UNKNOWN_TABLE
SELECT local.net_buffer_length;
@@ -214,11 +195,11 @@ SELECT net_buffer_length = @@session.net_buffer_length;
# Restore initial value #
####################################
+connection default;
+
SET @@global.net_buffer_length = @start_global_value;
# Due to differences in results of linux and windows
#SELECT @@global.net_buffer_length;
-SET @@session.net_buffer_length = @start_session_value;
-#SELECT @@session.net_buffer_length;
######################################################
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 111c723e19c..1f5ada76366 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -145,12 +145,12 @@ DELIMITER ;$$
let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status';
--source include/wait_condition.inc
+# The actual value doesn't matter and can vary based on test ordering and on ssl library.
+--replace_column 2 #
SELECT variable_name, variable_value FROM thread_status;
DROP TABLE thread_status;
SET GLOBAL event_scheduler=0;
---echo End of 5.1 tests
-
#
# Test to connect using a list of ciphers
@@ -190,3 +190,42 @@ INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1;
+
+#
+# Bug#39172: Asking for DH+non-RSA key with server set to use other key caused
+# YaSSL to crash the server.
+#
+
+# Common ciphers to openssl and yassl
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA
+--disable_output
+
+# Below here caused crashes. ################
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=NOT----EXIST
+# These probably exist but the server's keys can't be used to accept these kinds of connections.
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=DHE-DSS-AES128-RMD
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=DHE-DSS-AES128-SHA
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=DHE-DSS-AES256-RMD
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=DHE-DSS-AES256-SHA
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=DHE-DSS-DES-CBC3-RMD
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=EDH-DSS-DES-CBC3-SHA
+--error 1,0
+--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl-cipher';" --ssl-cipher=EDH-DSS-DES-CBC-SHA
+# End of crashers. ##########################
+
+# If this gives a result, then the bug is fixed.
+--enable_output
+select 'is still running; no cipher request crashed the server' as result from dual;
+
+##
+--echo End of 5.1 tests
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/packet.test b/mysql-test/t/packet.test
index 4de284b7824..93b46766d99 100644
--- a/mysql-test/t/packet.test
+++ b/mysql-test/t/packet.test
@@ -8,30 +8,30 @@
# Check protocol handling
#
-connect (con1,localhost,root,,);
-
-connection con1;
+# setting values below minimum threshold of 1024 will cause truncating
set global max_allowed_packet=100;
-set max_allowed_packet=100;
set global net_buffer_length=100;
-set net_buffer_length=100;
-# Have to be > 1024 as min value of net_buffer_length is 1024
+
+# is not yet in effect
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
-# Should return NULL as 2000 is bigger than max_allowed_packet
select repeat('a',2000);
#
-# Connection 2 should get error for too big packets
+# Connection 1 should get error for too big packets
#
-connect (con2,localhost,root,,);
-connection con2;
+connect (con1,localhost,root,,);
+connection con1;
select @@net_buffer_length, @@max_allowed_packet;
--error 1153
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
+
+#
+# Reset to default values and reconnect
+#
set global max_allowed_packet=default;
-set max_allowed_packet=default;
set global net_buffer_length=default;
-set net_buffer_length=default;
+connect (con2,localhost,root,,);
+connection con2;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
select length(repeat('a',2000));
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 5270eced05f..6a12e4a4d12 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,50 @@ drop table if exists t1, t2;
--enable_warnings
#
+# Bug#40954: Crash if range search and order by.
+#
+CREATE TABLE t1 (
+ pk INT NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (pk)
+)
+/*!50100 PARTITION BY HASH (pk)
+PARTITIONS 2 */;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
+DROP TABLE t1;
+
+#
+# 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 +164,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 +1636,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 +1840,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..c6bf0af0b6f 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -1,6 +1,90 @@
--source include/have_partition.inc
--source include/have_innodb.inc
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
+# with partitions
+CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
+PARTITION BY RANGE(id) (
+ PARTITION p0 VALUES LESS THAN (5),
+ PARTITION p1 VALUES LESS THAN (10),
+ PARTITION p2 VALUES LESS THAN MAXVALUE
+);
+
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
+ (9,9), (10,10), (11,11);
+
+SET @old_tx_isolation := @@session.tx_isolation;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+
+SET autocommit = 0;
+
+UPDATE t1 SET DATA = data*2 WHERE id = 3;
+
+# SHOW ENGINE InnoDB STATUS does not show transaction info in
+# PERFORMANCE-VERSION
+# grouping/referencing in replace_regex is very slow on long strings,
+# removing all before/after the interesting row before grouping/referencing
+#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+) lock struct\(s\), heap size [0-9]+, ([0-9]+) row lock\(s\).*/\1 lock struct(s) \2 row lock(s)/
+#SHOW ENGINE InnoDB STATUS;
+
+UPDATE t1 SET data = data*2 WHERE data = 2;
+
+# SHOW ENGINE InnoDB STATUS does not show transaction info in
+# PERFORMANCE-VERSION
+# grouping/referencing in replace_regex is very slow on long strings,
+# removing all before/after the interesting row before grouping/referencing
+#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
+#SHOW ENGINE InnoDB STATUS;
+
+SET @@session.tx_isolation = @old_tx_isolation;
+
+DROP TABLE t1;
+
+#
+# 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/perror-win.test b/mysql-test/t/perror-win.test
new file mode 100644
index 00000000000..cc09b8527be
--- /dev/null
+++ b/mysql-test/t/perror-win.test
@@ -0,0 +1,14 @@
+# Windows-specific tests
+--source include/windows.inc
+--require r/have_perror.require
+disable_query_log;
+eval select LENGTH("$MY_PERROR") > 0 as "have_perror";
+enable_query_log;
+
+
+--exec $MY_PERROR 150 2>&1
+--exec $MY_PERROR 23 2>&1
+--exec $MY_PERROR 1062 2>&1
+--error 1
+--exec $MY_PERROR 30000 2>&1
+
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/subselect.test b/mysql-test/t/subselect.test
index 5a79c937dd6..493857fb463 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3355,4 +3355,40 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT
SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a;
DROP TABLE t1,t2,t3;
+
+#
+# Bug#37460 Assertion failed:
+# !table->file || table->file->inited == handler::NONE
+#
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int);
+
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+
+CREATE VIEW v1 AS
+ SELECT t2.c AS c FROM t1, t2
+ WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+UPDATE v1 SET c=1;
+
+CREATE VIEW v2 (a,b) AS
+ SELECT t2.id, t2.c AS c FROM t1, t2
+ WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+
+--error 1369
+INSERT INTO v2(a,b) VALUES (2,2);
+INSERT INTO v2(a,b) VALUES (1,2);
+SELECT * FROM v1;
+
+CREATE VIEW v3 AS
+ SELECT t2.c AS c FROM t2
+ WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+
+DELETE FROM v3;
+
+DROP VIEW v1,v2,v3;
+DROP TABLE t1,t2;
+
--echo End of 5.1 tests.
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..b13640e7f3b 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'
@@ -194,26 +194,49 @@ DROP TABLE t1;
#
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
#
+# With Bug#41002 (symlink.test fails on symlinked datadir) it was
+# decided that the below statements may also succeed if the data
+# home directory is symlinked, e.g. mysql-test-run --mem.
+# This will be fixed in 6.0 only.
+#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
---error 1210
+--error 0,ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+#
--replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1
eval CREATE TABLE t1(a INT)
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var';
+
+#
# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
# silently ignored
#
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/timestamp_func.test b/mysql-test/t/timestamp_func.test
index ecca3c7daeb..e119f1b6253 100644
--- a/mysql-test/t/timestamp_func.test
+++ b/mysql-test/t/timestamp_func.test
@@ -9,6 +9,8 @@
# Creation Date: 2008-02-25 #
# Author: Sharique Abdullah #
# #
+# Modified: HHunger 2008-08-28 Reimplemented the test completely. #
+# #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
@@ -17,63 +19,32 @@
# #
############################################################################
---echo ** Setup **
---echo
-#
-# Setup
-#
---echo ** Connecting con0 using root **
-connect (con0,localhost,root,,);
---echo ** Connecting con1 using root **
-connect (con1, localhost, root,,);
-
---echo '#-----------------------------FN_DYNVARS_179_01------------------#'
-#
-# Checking for connection 1
-#
+# Change timestamp which must have an effect on now(), but not on sysdate().
+# Use Unix epoch timestamp
+# All comparisons must deliver true(1)
+# Exception: --sysdate-is-now switches off this behaviour and must not be set.
---echo ** Connection con0 **
-connection con0;
-SET @ts_old = @@SESSION.timestamp;
---echo waiting 1 sec
---sleep 1
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
---echo 1 means >=1 expected is true
+--echo ** Connecting con1 using root **
+connect (con1,localhost,root,,);
+SELECT date(now()) = date(sysdate());
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+# Assure that setting of the variable has no effect on other session.
+--echo ** Connecting con0 using root **
+connect (con0,localhost,root,,);
+SELECT @@session.timestamp != 1100000000;
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
-#
-# Checking for connection 2
-#
--echo ** Connection con1 **
connection con1;
-SET @ts_old = @@SESSION.timestamp;
---echo waiting 4 sec
---sleep 4
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
---echo 1 means >=4 expected is true
-
---echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
-#
-# Testing timezone change effect
-#
-
-SET @ts_old = @@SESSION.timestamp;
---sleep 1
---echo Changing time zone
-SET time_zone = 'MET';
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
---echo 1 means >=1 expected is true
-
-#
-# Cleanup
-#
---echo ** Cleanup **
+SELECT @@session.timestamp != 1000000000;
+SELECT @@session.timestamp = 1100000000;
--echo ** Connection default **
connection default;
--echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
+
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt b/mysql-test/t/timestamp_sysdate_is_now_func-master.opt
new file mode 100644
index 00000000000..97a58d28032
--- /dev/null
+++ b/mysql-test/t/timestamp_sysdate_is_now_func-master.opt
@@ -0,0 +1 @@
+--sysdate-is-now
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func.test b/mysql-test/t/timestamp_sysdate_is_now_func.test
new file mode 100644
index 00000000000..7ca3b4cddac
--- /dev/null
+++ b/mysql-test/t/timestamp_sysdate_is_now_func.test
@@ -0,0 +1,47 @@
+############################################################################
+# #
+# Variable Name: timestamp with sysdate-is-now #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: INTEGER #
+# #
+# #
+# Creation Date: 2008-11-25 #
+# Author: Horst Hunger #
+# #
+# Description: Test Cases of Dynamic System Variable "timestamp" #
+# that checks behavior of this variable in the following ways #
+# * Like timstamp_func, but with set "sysdate-is-now". #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
+# #
+############################################################################
+
+# Use Unix epoch timestamp
+# Due to "--sysdate-is-now" timestamp must have an effect on both.
+# See also timestamp_func.test.
+
+--echo ** Connecting con1 using root **
+connect (con1,localhost,root,,);
+SELECT date(now()) = date(sysdate());
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+
+# Assure that setting of the variable has no effect on other session.
+--echo ** Connecting con0 using root **
+connect (con0,localhost,root,,);
+SELECT @@session.timestamp != 1100000000;
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+
+--echo ** Connection con1 **
+connection con1;
+SELECT @@session.timestamp != 1000000000;
+SELECT @@session.timestamp = 1100000000;
+
+--echo ** Connection default **
+connection default;
+--echo Disconnecting Connections con0, con1
+disconnect con0;
+disconnect con1;
+
diff --git a/mysql-test/t/timezone3.test b/mysql-test/t/timezone3.test
index 0aedbafcec4..8a9941f6383 100644
--- a/mysql-test/t/timezone3.test
+++ b/mysql-test/t/timezone3.test
@@ -45,6 +45,10 @@ insert into t1 values
(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00');
+insert into t1 values
+ (unix_timestamp('2009-01-01 02:59:59'),'2009-01-01 02:59:59'),
+ (unix_timestamp('2009-01-01 03:00:00'),'2009-01-01 03:00:00');
+
select i, from_unixtime(i), c from t1;
drop table t1;
@@ -58,4 +62,12 @@ insert into t1 values (19730101235900), (20040101235900);
select * from t1;
drop table t1;
+#
+# Test Bug #39920: MySQL cannot deal with Leap Second expression in string
+# literal
+#
+
+# 2009-01-01 02:59:59, 2009-01-01 02:59:60 and 2009-01-01 03:00:00
+SELECT FROM_UNIXTIME(1230768022), FROM_UNIXTIME(1230768023), FROM_UNIXTIME(1230768024);
+
# End of 4.1 tests
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/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 4a6462a8e72..4cf9ea63dad 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1235,6 +1235,16 @@ DROP TABLE t1;
select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000);
+#
+# Bug #31616 div_precision_increment description looks wrong
+#
+
+create table t1 as select 5.05 / 0.014;
+show warnings;
+show create table t1;
+select * from t1;
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index f58cd54250b..ad4d57b7128 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -861,8 +861,10 @@ drop tables t1,t2,t3;
# exceeds mediumtext maximum length
#
-SELECT @tmp_max:= @@max_allowed_packet;
-SET max_allowed_packet=25000000;
+SELECT @tmp_max:= @@global.max_allowed_packet;
+SET @@global.max_allowed_packet=25000000;
+# switching connection to allow the new max_allowed_packet take effect
+--connect (newconn, localhost, root,,)
CREATE TABLE t1 (a mediumtext);
CREATE TABLE t2 (b varchar(20));
INSERT INTO t1 VALUES ('a');
@@ -884,7 +886,9 @@ INSERT INTO t1 VALUES ('a');
CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
SHOW CREATE TABLE t3;
DROP TABLES t1,t2,t3;
-SET max_allowed_packet:= @tmp_max;
+--connection default
+SET @@global.max_allowed_packet:= @tmp_max;
+--disconnect newconn
#
# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index f79c9e773aa..7d56df259ba 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -430,4 +430,25 @@ drop table t1,t2;
connection default;
disconnect con1;
+#
+# Bug #40745: Error during WHERE clause calculation in UPDATE
+# leads to an assertion failure
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE FUNCTION f1() RETURNS INT RETURN f1();
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1);
+
+--error ER_SP_NO_RECURSION
+UPDATE t1 SET i = 3 WHERE f1();
+--error ER_SP_NO_RECURSION
+UPDATE t1 SET i = f1();
+
+DROP TABLE t1;
+DROP FUNCTION f1;
+
--echo End of 5.0 tests
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/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 79011a89b36..823fecb8791 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -28,3 +28,83 @@ set global slave_net_timeout=default;
# sql_slave_skip_counter is write-only, so we can't save previous
# value and restore it here. That's ok, because it's normally 0.
set global sql_slave_skip_counter= 0;
+
+#
+# Bug#28234 - global/session scope - documentation vs implementation
+#
+--echo
+#
+# Additional variables fixed from sql_repl.cc.
+#
+--echo #
+SHOW VARIABLES like 'log_slave_updates';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_slave_updates;
+SELECT @@global.log_slave_updates;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_slave_updates= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_slave_updates= true;
+#
+--echo #
+SHOW VARIABLES like 'relay_log';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log;
+SELECT @@global.relay_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_index';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_index;
+SELECT @@global.relay_log_index;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_index= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_index= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_info_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_info_file;
+SELECT @@global.relay_log_info_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_info_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_info_file= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_space_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_space_limit;
+SELECT @@global.relay_log_space_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_space_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_space_limit= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'slave_load_tmpdir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.slave_load_tmpdir;
+--replace_column 1 #
+SELECT @@global.slave_load_tmpdir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.slave_load_tmpdir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.slave_load_tmpdir= 'x';
+#
+--echo #
+SHOW VARIABLES like 'slave_skip_errors';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.slave_skip_errors;
+SELECT @@global.slave_skip_errors;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.slave_skip_errors= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.slave_skip_errors= 7;
+#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 221f46605cd..828cb3a2916 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -146,25 +146,23 @@ show global variables like 'myisam_max_sort_file_size';
--replace_result 9223372036853727232 FILE_SIZE 2146435072 FILE_SIZE
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
+# bug#22891: modified to take read-only SESSION net_buffer_length into account
set global net_retry_count=10, session net_retry_count=10;
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
-set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
show global variables like 'net_%';
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
show session variables like 'net_%';
select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
-set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
show global variables like 'net_%';
select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
-show session variables like 'net_%';
-select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
-set net_buffer_length=1;
-show variables like 'net_buffer_length';
-select * from information_schema.session_variables where variable_name like 'net_buffer_length';
+set global net_buffer_length=1;
+show global variables like 'net_buffer_length';
+select * from information_schema.global_variables where variable_name like 'net_buffer_length';
#warning 1292
-set net_buffer_length=2000000000;
-show variables like 'net_buffer_length';
-select * from information_schema.session_variables where variable_name like 'net_buffer_length';
+set global net_buffer_length=2000000000;
+show global variables like 'net_buffer_length';
+select * from information_schema.global_variables where variable_name like 'net_buffer_length';
set character set cp1251_koi8;
show variables like "character_set_client";
@@ -274,7 +272,7 @@ select @@long_query_time;
set long_query_time=100.000001;
select @@long_query_time;
set low_priority_updates=1;
-set max_allowed_packet=100;
+set global max_allowed_packet=100;
set global max_binlog_cache_size=100;
set global max_binlog_size=100;
set global max_connect_errors=100;
@@ -288,7 +286,7 @@ set global max_user_connections=100;
select @@max_user_connections;
set global max_write_lock_count=100;
set myisam_sort_buffer_size=100;
-set net_buffer_length=100;
+set global net_buffer_length=100;
set net_read_timeout=100;
set net_write_timeout=100;
set global query_cache_limit=100;
@@ -795,3 +793,287 @@ SET GLOBAL log_output = 0;
--echo
--echo # -- End of Bug#34820.
+#
+# Bug#28234 - global/session scope - documentation vs implementation
+#
+--echo
+--echo #
+SHOW VARIABLES like 'ft_max_word_len';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_max_word_len;
+SELECT @@global.ft_max_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_max_word_len= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_max_word_len= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_min_word_len';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_min_word_len;
+SELECT @@global.ft_min_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_min_word_len= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_min_word_len= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_query_expansion_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_query_expansion_limit;
+SELECT @@global.ft_query_expansion_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_query_expansion_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_query_expansion_limit= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_stopword_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_stopword_file;
+SELECT @@global.ft_stopword_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_stopword_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_stopword_file= 'x';
+#
+# Additional variables fixed.
+#
+--echo #
+SHOW VARIABLES like 'back_log';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.back_log;
+SELECT @@global.back_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.back_log= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.back_log= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_files_support';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_files_support;
+--replace_column 1 #
+SELECT @@global.large_files_support;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_files_support= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_files_support= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'character_sets_dir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.character_sets_dir;
+--replace_column 1 #
+SELECT @@global.character_sets_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.character_sets_dir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.character_sets_dir= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'init_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.init_file;
+--replace_column 1 #
+SELECT @@global.init_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.init_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.init_file= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'language';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.language;
+--replace_column 1 #
+SELECT @@global.language;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.language= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.language= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_page_size';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_page_size;
+--replace_column 1 #
+SELECT @@global.large_page_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_page_size= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_page_size= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_pages';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_pages;
+--replace_column 1 #
+SELECT @@global.large_pages;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_pages= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_pages= true;
+#
+--echo #
+SHOW VARIABLES like 'log_bin';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin;
+SELECT @@global.log_bin;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'log_error';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_error;
+--replace_column 1 #
+SELECT @@global.log_error;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_error= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_error= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'lower_case_file_system';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.lower_case_file_system;
+--replace_column 1 #
+SELECT @@global.lower_case_file_system;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.lower_case_file_system= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.lower_case_file_system= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'lower_case_table_names';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.lower_case_table_names;
+--replace_column 1 #
+SELECT @@global.lower_case_table_names;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.lower_case_table_names= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.lower_case_table_names= 7;
+#
+--echo #
+SHOW VARIABLES like 'myisam_recover_options';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.myisam_recover_options;
+SELECT @@global.myisam_recover_options;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.myisam_recover_options= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.myisam_recover_options= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'open_files_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.open_files_limit;
+--replace_column 1 #
+SELECT @@global.open_files_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.open_files_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.open_files_limit= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'pid_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.pid_file;
+--replace_column 1 #
+SELECT @@global.pid_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.pid_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.pid_file= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'plugin_dir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.plugin_dir;
+--replace_column 1 #
+SELECT @@global.plugin_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.plugin_dir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.plugin_dir= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'port';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.port;
+--replace_column 1 #
+SELECT @@global.port;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.port= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.port= 7;
+#
+--echo #
+SHOW VARIABLES like 'protocol_version';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.protocol_version;
+SELECT @@global.protocol_version;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.protocol_version= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.protocol_version= 7;
+#
+--echo #
+SHOW VARIABLES like 'skip_external_locking';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_external_locking;
+SELECT @@global.skip_external_locking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_external_locking= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_external_locking= true;
+#
+--echo #
+SHOW VARIABLES like 'skip_networking';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_networking;
+SELECT @@global.skip_networking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_networking= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_networking= true;
+#
+--echo #
+SHOW VARIABLES like 'skip_show_database';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_show_database;
+SELECT @@global.skip_show_database;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_show_database= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_show_database= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'thread_stack';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.thread_stack;
+--replace_column 1 #
+SELECT @@global.thread_stack;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.thread_stack= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.thread_stack= 7;
+#
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 7db1a693a93..1ea248f1fe9 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -510,7 +510,7 @@ drop table t1;
#
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
---error ER_WRONG_USAGE
+--error ER_KEY_DOES_NOT_EXITS
select b from v1 use index (some_index) where b=1;
drop view v1;
drop table t1;
@@ -3421,11 +3421,11 @@ drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT * FROM t1;
---error ER_WRONG_USAGE
+--error ER_KEY_DOES_NOT_EXITS
SELECT * FROM v1 USE KEY(non_existant);
---error ER_WRONG_USAGE
+--error ER_KEY_DOES_NOT_EXITS
SELECT * FROM v1 FORCE KEY(non_existant);
---error ER_WRONG_USAGE
+--error ER_KEY_DOES_NOT_EXITS
SELECT * FROM v1 IGNORE KEY(non_existant);
DROP VIEW v1;
@@ -3556,6 +3556,41 @@ 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;
+
+#
+# Bug #33461: SELECT ... FROM <view> USE INDEX (...) throws an error
+#
+
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2));
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2;
+SELECT * FROM t1 USE INDEX (c2) WHERE c2=2;
+
+CREATE VIEW v1 AS SELECT c1, c2 FROM t1;
+SHOW INDEX FROM v1;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 USE INDEX (c2) WHERE c2=2;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2;
+--error ER_KEY_DOES_NOT_EXITS
+SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.0 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/wait_timeout_func.test b/mysql-test/t/wait_timeout_func.test
index e825b5a3a39..6b7c8d016d2 100644
--- a/mysql-test/t/wait_timeout_func.test
+++ b/mysql-test/t/wait_timeout_func.test
@@ -11,93 +11,87 @@
# Creation Date: 2008-03-07 #
# Author: Salman Rawala #
# #
+# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps. #
+# #
# Description: Test Cases of Dynamic System Variable wait_timeout #
# that checks the functionality of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_wait_timeouts #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
--source include/not_embedded.inc
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-##############################
-# Creating two new tables #
-##############################
-
---echo ## Creating new table t1 ##
-CREATE TABLE t1
-(
-id INT NOT NULL auto_increment,
-PRIMARY KEY (id),
-name VARCHAR(30)
-);
+SET @start_value= @@global.wait_timeout;
--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
#######################################################################
-# Setting initial value of interactive_timeout greater than sleep and
-# verifying its behavior on session scope
+# 1. test of scope session
#######################################################################
---echo ## Creating new connection test_con1 ##
+SET @start_time= UNIX_TIMESTAMP();
+--echo connect (test_con1, localhost, root,,);
connect (test_con1, localhost, root,,);
connection test_con1;
---echo ## Setting value of variable to 5 ##
-SET @@session.wait_timeout = 5;
-
---echo ## Inserting record in table t1 ##
-INSERT into t1(name) values('Record_1');
-
---echo ## Using sleep to check timeout ##
-sleep 4;
-
-
---echo '#--------------------FN_DYNVARS_186_02-------------------------#'
-#######################################################################
-# Setting initial value of interactive_timeout greater than sleep and
-# verifying its behavior on global scope
-#######################################################################
+# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
---echo ## Setting value of variable ##
-SET @@global.wait_timeout = 5;
+# Find a small value <> @@global.wait_timeout.
+let $session_value =
+`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
+--replace_result $session_value <session_value>
+eval SET @@session.wait_timeout = $session_value;
---echo ## Creating new connection test_con2 ##
+--echo connect (test_con2, localhost, root,,);
connect (test_con2, localhost, root,,);
connection test_con2;
-INSERT into t1(name) values('Record_2');
-
---echo ## Using sleep to check timeout ##
-sleep 4;
-
+--replace_result $session_value <session_value>
+eval SET @@session.wait_timeout = $session_value - 1;
+--echo connection default;
+connection default;
+--echo wait until connections ready
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+SELECT info FROM information_schema.processlist;
--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
#######################################################################
-# Setting initial value of interactive_timeout less than sleep and
-# verifying its behavior on global scope
+# 2. test of scope global
#######################################################################
---echo ## Setting value of variable to 1 ##
-SET @@global.wait_timeout = 1;
+# Find a small value <> @@global.wait_timeout.
+let $global_value = $session_value + 1;
+--replace_result $global_value <global_value>
+eval SET @@global.wait_timeout= $global_value;
---echo ## Creating new connection ##
+# Changing the @@global.wait_timeout has no influence on the
+# @@session.wait_timeout of already established sessions.
+SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
+
+--echo connect (test_con3, localhost, root,,);
connect (test_con3, localhost, root,,);
connection test_con3;
-INSERT into t1(name) values('Record_3');
-
---echo ## Using sleep to check timeout ##
-sleep 5;
-
---echo ## We cannot test it further because the server stops due to wait_timeout ##
---Error 2006
-SELECT * from t1;
+# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
+
+--echo connection default;
+connection default;
+# We can be sure that the connections test_con1 and test_con2 must be
+# established because both have already executed a SET @@session.wait_timeout.
+# This means they are or at least were visible within the processlist.
+# Therefore we can now simply wait till both disappear from the processlist.
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+SELECT info FROM information_schema.processlist;
+
+--replace_result $global_value <global_value> $session_value <session_value>;
+eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value;
+SET @@global.wait_timeout= @start_value;
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 cb1b07c83b0..64c439314a9 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -444,6 +444,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.
#