summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/archive/archive.result15
-rw-r--r--mysql-test/suite/archive/archive.test23
-rw-r--r--mysql-test/suite/archive/archive_gis.result4
-rw-r--r--mysql-test/suite/atomic/alter_partition,innodb.rdiff525
-rw-r--r--mysql-test/suite/atomic/alter_partition.combinations6
-rw-r--r--mysql-test/suite/atomic/alter_partition.result743
-rw-r--r--mysql-test/suite/atomic/alter_partition.test174
-rw-r--r--mysql-test/suite/binlog/include/mysqlbinlog_gtid_strict_mode.inc421
-rw-r--r--mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc606
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_glle_ordered.result19
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_strict_mode.result925
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result468
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_alter_verbose.result15
-rw-r--r--mysql-test/suite/binlog/r/start_alter_mysqlbinlog_replay.result42
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test43
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_strict_mode.test105
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_window.test151
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_alter_verbose.test58
-rw-r--r--mysql-test/suite/binlog/t/start_alter_mysqlbinlog_replay.test61
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor.result47
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-inout.result2571
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-param.result46
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-row.result8
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result14
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cursor.test55
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-inout.test2497
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-row.test8
-rw-r--r--mysql-test/suite/encryption/r/bulk_insert.result7
-rw-r--r--mysql-test/suite/encryption/r/corrupted_during_recovery.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result28
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result18
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result8
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result8
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-nokeys.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result66
-rw-r--r--mysql-test/suite/encryption/r/tempfiles_encrypted.result360
-rw-r--r--mysql-test/suite/encryption/t/bulk_insert.opt1
-rw-r--r--mysql-test/suite/encryption/t/bulk_insert.test11
-rw-r--r--mysql-test/suite/encryption/t/corrupted_during_recovery.test6
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test20
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test10
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test4
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test8
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.test2
-rw-r--r--mysql-test/suite/engines/funcs/r/ix_using_order.result4
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result12
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result12
-rw-r--r--mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test12
-rw-r--r--mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test12
-rw-r--r--mysql-test/suite/federated/error_row_number.result26
-rw-r--r--mysql-test/suite/federated/error_row_number.test18
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.result166
-rw-r--r--mysql-test/suite/federated/indexes.result33
-rw-r--r--mysql-test/suite/federated/indexes.test22
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result32
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines_embedded.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result192
-rw-r--r--mysql-test/suite/galera/disabled.def1
-rw-r--r--mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc4
-rw-r--r--mysql-test/suite/galera/r/MDEV-27001.result6
-rw-r--r--mysql-test/suite/galera/r/MW-416.result12
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave.result6
-rw-r--r--mysql-test/suite/galera/r/galera_defaults.result8
-rw-r--r--mysql-test/suite/galera/r/galera_myisam_transactions.result8
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result34
-rw-r--r--mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result26
-rw-r--r--mysql-test/suite/galera/t/MDEV-27001.opt1
-rw-r--r--mysql-test/suite/galera/t/MDEV-27001.test7
-rw-r--r--mysql-test/suite/galera/t/MW-416.test12
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave.test16
-rw-r--r--mysql-test/suite/galera/t/galera_backup_stage.test6
-rw-r--r--mysql-test/suite/galera/t/galera_defaults.test2
-rw-r--r--mysql-test/suite/galera/t/galera_myisam_transactions.test4
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test14
-rw-r--r--mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test13
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def2
-rw-r--r--mysql-test/suite/galera_3nodes/r/GCF-363.result4
-rw-r--r--mysql-test/suite/galera_3nodes/t/GCF-363.test6
-rw-r--r--mysql-test/suite/gcol/inc/gcol_column_def_options.inc2
-rw-r--r--mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc12
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result2
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result14
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result14
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result2
-rw-r--r--mysql-test/suite/heap/heap_hash.result22
-rw-r--r--mysql-test/suite/heap/heap_hash.test20
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_bzip2.opt1
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lz4.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lzma.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lzo.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_snappy.opt2
-rw-r--r--mysql-test/suite/innodb/include/no_checkpoint_end.inc15
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result2
-rw-r--r--mysql-test/suite/innodb/r/autoinc_persist,desc.rdiff769
-rw-r--r--mysql-test/suite/innodb/r/autoinc_persist.result11
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded.result10
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded.result14
-rw-r--r--mysql-test/suite/innodb/r/corrupted_during_recovery.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-index,debug.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result48
-rw-r--r--mysql-test/suite/innodb/r/innodb-online-alter-gis.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_buffer_pool_resize.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_gis.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb_status_variables.result3
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff9
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff9
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result214
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result12
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_import.result2
-rw-r--r--mysql-test/suite/innodb/r/log_corruption.result66
-rw-r--r--mysql-test/suite/innodb/r/log_file.result5
-rw-r--r--mysql-test/suite/innodb/r/log_file_name_debug.result17
-rw-r--r--mysql-test/suite/innodb/r/log_file_size.result47
-rw-r--r--mysql-test/suite/innodb/r/monitor.result10
-rw-r--r--mysql-test/suite/innodb/r/online_table_rebuild.result20
-rw-r--r--mysql-test/suite/innodb/r/rename_table.result2
-rw-r--r--mysql-test/suite/innodb/r/truncate_missing.result2
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test5
-rw-r--r--mysql-test/suite/innodb/t/alter_missing_tablespace.test2
-rw-r--r--mysql-test/suite/innodb/t/autoinc_persist.combinations2
-rw-r--r--mysql-test/suite/innodb/t/autoinc_persist.test56
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_loaded.combinations19
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_loaded.test18
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_unloaded.combinations14
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_unloaded.test13
-rw-r--r--mysql-test/suite/innodb/t/corrupted_during_recovery.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online-fk.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test68
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5980-alter.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_28867993.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize_temporary.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44571.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_page_compressed.combinations5
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.opt1
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test213
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_import.test2
-rw-r--r--mysql-test/suite/innodb/t/log_corruption.test82
-rw-r--r--mysql-test/suite/innodb/t/log_file.test6
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test3
-rw-r--r--mysql-test/suite/innodb/t/log_file_name_debug.test49
-rw-r--r--mysql-test/suite/innodb/t/log_file_size.test136
-rw-r--r--mysql-test/suite/innodb/t/missing_tablespaces.test2
-rw-r--r--mysql-test/suite/innodb/t/online_table_rebuild.test24
-rw-r--r--mysql-test/suite/innodb/t/rename_table.test2
-rw-r--r--mysql-test/suite/innodb/t/restart.test2
-rw-r--r--mysql-test/suite/innodb/t/truncate_missing.test2
-rw-r--r--mysql-test/suite/innodb_fts/r/create.result25
-rw-r--r--mysql-test/suite/innodb_fts/r/versioning.result3
-rw-r--r--mysql-test/suite/innodb_fts/t/create.test20
-rw-r--r--mysql-test/suite/innodb_fts/t/versioning.combinations2
-rw-r--r--mysql-test/suite/innodb_fts/t/versioning.opt2
-rw-r--r--mysql-test/suite/innodb_fts/t/versioning.test131
-rw-r--r--mysql-test/suite/innodb_gis/r/0.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/1.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/geometry.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/gis.result4
-rw-r--r--mysql-test/suite/innodb_gis/t/1.test4
-rw-r--r--mysql-test/suite/innodb_gis/t/gis.test4
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result2
-rw-r--r--mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test2
-rw-r--r--mysql-test/suite/json/r/json_no_table.result2
-rw-r--r--mysql-test/suite/json/r/json_table.result18
-rw-r--r--mysql-test/suite/json/r/json_table_mysql.result18
-rw-r--r--mysql-test/suite/json/r/type_json.result58
-rw-r--r--mysql-test/suite/maria/maria2.result97
-rw-r--r--mysql-test/suite/maria/maria2.test80
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.combinations14
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.result27
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.test38
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.combinations14
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.result22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.test35
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn,strict_crc32.rdiff11
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.result4
-rw-r--r--mysql-test/suite/mariabackup/huge_lsn.test52
-rw-r--r--mysql-test/suite/mariabackup/incremental_page_compressed.result13
-rw-r--r--mysql-test/suite/mariabackup/incremental_page_compressed.test38
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt2
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_overwrite.opt2
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_overwrite.result28
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_overwrite.test27
-rw-r--r--mysql-test/suite/mariabackup/missing_ibd.test2
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.result4
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.test6
-rw-r--r--mysql-test/suite/multi_source/change_master.result8
-rw-r--r--mysql-test/suite/multi_source/change_master.test13
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.result370
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.test438
-rw-r--r--mysql-test/suite/parts/inc/engines.combinations8
-rw-r--r--mysql-test/suite/parts/inc/engines.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition.pre2
-rw-r--r--mysql-test/suite/parts/inc/partition_alter_1.inc6
-rw-r--r--mysql-test/suite/parts/inc/partition_fail.inc11
-rw-r--r--mysql-test/suite/parts/inc/partition_fail_t2.inc20
-rw-r--r--mysql-test/suite/parts/r/alter_table,list.rdiff85
-rw-r--r--mysql-test/suite/parts/r/alter_table.result316
-rw-r--r--mysql-test/suite/parts/r/debug_innodb_fail.result279
-rw-r--r--mysql-test/suite/parts/r/debug_myisam_fail.result279
-rw-r--r--mysql-test/suite/parts/r/engine_defined_part_attributes.result288
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result160
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_myisam.result160
-rw-r--r--mysql-test/suite/parts/r/partition_debug.result3478
-rw-r--r--mysql-test/suite/parts/r/partition_debug_innodb.result252
-rw-r--r--mysql-test/suite/parts/t/alter_table.combinations2
-rw-r--r--mysql-test/suite/parts/t/alter_table.test273
-rw-r--r--mysql-test/suite/parts/t/engine_defined_part_attributes.test221
-rw-r--r--mysql-test/suite/parts/t/partition_debug.test111
-rw-r--r--mysql-test/suite/perfschema/include/default_mysqld_autosize.cnf5
-rw-r--r--mysql-test/suite/perfschema/r/digest_view.result50
-rw-r--r--mysql-test/suite/perfschema/r/max_program_zero.result2
-rw-r--r--mysql-test/suite/perfschema/r/misc.result13
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result2
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_transactions.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_memory_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_variables.result2
-rw-r--r--mysql-test/suite/perfschema/r/statement_program_lost_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/sxlock_func.result2
-rw-r--r--mysql-test/suite/perfschema/t/misc.test20
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff40
-rw-r--r--mysql-test/suite/plugins/r/compression.result22
-rw-r--r--mysql-test/suite/plugins/r/compression_load.result33
-rw-r--r--mysql-test/suite/plugins/r/cracklib_password_check.result16
-rw-r--r--mysql-test/suite/plugins/r/password_reuse_check.result94
-rw-r--r--mysql-test/suite/plugins/r/show_all_plugins.result4
-rw-r--r--mysql-test/suite/plugins/r/simple_password_check.result4
-rw-r--r--mysql-test/suite/plugins/r/test_sql_service.result96
-rw-r--r--mysql-test/suite/plugins/t/compression.combinations29
-rw-r--r--mysql-test/suite/plugins/t/compression.test52
-rw-r--r--mysql-test/suite/plugins/t/compression_load.test24
-rw-r--r--mysql-test/suite/plugins/t/cracklib_password_check.test8
-rw-r--r--mysql-test/suite/plugins/t/password_reuse_check.test100
-rw-r--r--mysql-test/suite/plugins/t/test_sql_service.test68
-rw-r--r--mysql-test/suite/roles/definer.result7
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_master.test2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc18
-rw-r--r--mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc60
-rw-r--r--mysql-test/suite/rpl/include/start_alter_basic.inc60
-rw-r--r--mysql-test/suite/rpl/include/start_alter_concurrent.inc230
-rw-r--r--mysql-test/suite/rpl/include/start_alter_include.inc64
-rw-r--r--mysql-test/suite/rpl/include/start_alter_options.inc399
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_rollback.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_1.result313
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_2.result326
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_3.result326
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_4.result327
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_5.result327
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_6.result329
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_7.result368
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_8.result362
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_bugs.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_chain_basic.result83
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_ftwrl.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_instant.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result172
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result419
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_optimize.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_options.result497
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_para_to_seq.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result119
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result6
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_rollback.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_1.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_2.test53
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_3.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_4.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_5.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_6.test58
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_7.cnf19
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_7.test112
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_8.cnf19
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_8.test109
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_bugs.test47
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.cnf24
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.test54
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_ftwrl.test91
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_instant.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test39
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.cnf19
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test164
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_optimize.test25
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_options.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_para_to_seq.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test76
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test121
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test6
-rw-r--r--mysql-test/suite/s3/mysqldump.result6
-rw-r--r--mysql-test/suite/sql_sequence/mysqldump.result16
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_alter_two_phase.result53
-rw-r--r--mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result102
-rw-r--r--mysql-test/suite/sys_vars/r/histogram_type_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result88
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff88
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result41
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result14
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep.result30
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_alter_two_phase.test52
-rw-r--r--mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test86
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test93
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_innodb.test1
-rw-r--r--mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result4
-rw-r--r--mysql-test/suite/sysschema/r/pr_table_exists.result2
-rw-r--r--mysql-test/suite/vcol/r/binlog.result2
-rw-r--r--mysql-test/suite/versioning/r/data.result59
-rw-r--r--mysql-test/suite/versioning/r/partition,heap.rdiff86
-rw-r--r--mysql-test/suite/versioning/r/partition.result395
-rw-r--r--mysql-test/suite/versioning/t/alter.test4
-rw-r--r--mysql-test/suite/versioning/t/create.test6
-rw-r--r--mysql-test/suite/versioning/t/data.test32
-rw-r--r--mysql-test/suite/versioning/t/partition.test228
-rw-r--r--mysql-test/suite/wsrep/r/variables.result4
-rw-r--r--mysql-test/suite/wsrep/r/variables_debug.result3
427 files changed, 27749 insertions, 2752 deletions
diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result
index fa2b4f7ee00..022b400fd97 100644
--- a/mysql-test/suite/archive/archive.result
+++ b/mysql-test/suite/archive/archive.result
@@ -1,6 +1,5 @@
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
-DROP TABLE if exists t1,t2,t3,t4,t5,t6;
SET default_storage_engine=ARCHIVE;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -12881,6 +12880,9 @@ show warnings;
Level Code Message
Error 1194 Table 't1' is marked as crashed and should be repaired
drop table t1;
+#
+# temporary archive
+#
create temporary table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
select * from t1;
@@ -12906,3 +12908,14 @@ t1 CREATE TEMPORARY TABLE `t1` (
`b` varchar(10) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
+#
+# End of 10.0 tests
+#
+#
+# MDEV-27396 DESC index attribute remains in Archive table definition, despite being apparently ignored
+#
+create table t (t int auto_increment, key (t desc)) engine=archive;
+ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
+#
+# End of 10.8 tests
+#
diff --git a/mysql-test/suite/archive/archive.test b/mysql-test/suite/archive/archive.test
index 2d184110a2d..b6920827005 100644
--- a/mysql-test/suite/archive/archive.test
+++ b/mysql-test/suite/archive/archive.test
@@ -7,10 +7,6 @@
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
---disable_warnings
-DROP TABLE if exists t1,t2,t3,t4,t5,t6;
---enable_warnings
-
SET default_storage_engine=ARCHIVE;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
@@ -1770,9 +1766,9 @@ select * from t1;
show warnings;
drop table t1;
-#
-# temporary archive
-#
+--echo #
+--echo # temporary archive
+--echo #
create temporary table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
select * from t1;
@@ -1782,3 +1778,16 @@ select * from t1;
show create table t1;
drop table t1;
+--echo #
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-27396 DESC index attribute remains in Archive table definition, despite being apparently ignored
+--echo #
+--error ER_CANT_CREATE_TABLE
+create table t (t int auto_increment, key (t desc)) engine=archive;
+
+--echo #
+--echo # End of 10.8 tests
+--echo #
diff --git a/mysql-test/suite/archive/archive_gis.result b/mysql-test/suite/archive/archive_gis.result
index b629f09f5f2..a137888662f 100644
--- a/mysql-test/suite/archive/archive_gis.result
+++ b/mysql-test/suite/archive/archive_gis.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/atomic/alter_partition,innodb.rdiff b/mysql-test/suite/atomic/alter_partition,innodb.rdiff
new file mode 100644
index 00000000000..571136eb626
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition,innodb.rdiff
@@ -0,0 +1,525 @@
+--- alter_partition.result
++++ alter_partition,innodb.reject
+@@ -17,12 +17,9 @@
+ end $
+ # QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ # CRASH: crash_create_before_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -38,12 +35,9 @@
+ 12
+ 22
+ # CRASH: crash_alter_partition_after_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -59,12 +53,9 @@
+ 12
+ 22
+ # CRASH: crash_alter_partition_after_write_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -80,12 +71,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_1
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -101,12 +89,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_2
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -122,12 +107,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_3
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -143,12 +125,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_4
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -164,12 +143,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_5
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -185,12 +161,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_6
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -206,12 +179,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_7
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -227,12 +197,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_8
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -248,15 +215,12 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_9
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -275,15 +239,12 @@
+ x
+ 12
+ # CRASH: crash_convert_partition_10
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -302,15 +263,12 @@
+ x
+ 12
+ # CRASH: crash_convert_partition_11
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -330,14 +288,10 @@
+ 12
+ # QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+ # NO CRASH: crash_create_before_create_frm
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -357,14 +311,10 @@
+ 32
+ 39
+ # NO CRASH: crash_alter_partition_after_create_frm
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -384,14 +334,10 @@
+ 32
+ 39
+ # NO CRASH: crash_alter_partition_after_write_frm
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -411,17 +357,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_1
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -442,17 +384,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_2
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -473,17 +411,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_3
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -504,17 +438,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_4
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -535,17 +465,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_5
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -566,17 +492,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_6
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -597,17 +519,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_7
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -628,17 +546,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_8
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -659,14 +573,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_9
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -686,14 +596,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_10
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -713,14 +619,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_11
+-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#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
diff --git a/mysql-test/suite/atomic/alter_partition.combinations b/mysql-test/suite/atomic/alter_partition.combinations
new file mode 100644
index 00000000000..898d2f2f332
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.combinations
@@ -0,0 +1,6 @@
+[innodb]
+innodb
+
+[myisam]
+
+[aria]
diff --git a/mysql-test/suite/atomic/alter_partition.result b/mysql-test/suite/atomic/alter_partition.result
new file mode 100644
index 00000000000..c4af43ad1bd
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.result
@@ -0,0 +1,743 @@
+# Crash recovery
+create or replace procedure prepare_table(r int)
+begin
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition pn values less than (30));
+insert into t1 values (2), (12), (22);
+if r > 1 then
+create or replace table tp2 (x int)
+with system versioning;
+insert into tp2 values (32), (39);
+end if;
+flush tables;
+end $
+# QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+# CRASH: crash_create_before_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_alter_partition_after_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_alter_partition_after_write_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_1
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_2
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_3
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_4
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_5
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_6
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_7
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_8
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_9
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+12
+# CRASH: crash_convert_partition_10
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+12
+# CRASH: crash_convert_partition_11
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+12
+# QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+# NO CRASH: crash_create_before_create_frm
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# NO CRASH: crash_alter_partition_after_create_frm
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# NO CRASH: crash_alter_partition_after_write_frm
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_1
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_2
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_3
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_4
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_5
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_6
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_7
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_8
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_9
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_10
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_11
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+Warnings:
+Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/atomic/alter_partition.test b/mysql-test/suite/atomic/alter_partition.test
new file mode 100644
index 00000000000..23b996cf5a1
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.test
@@ -0,0 +1,174 @@
+--source include/have_partition.inc
+--source include/have_debug.inc
+--source include/have_sequence.inc
+--source include/binlog_combinations.inc
+--source include/have_binlog_format_row_or_statement.inc
+--source include/not_valgrind.inc
+
+let $default_engine=InnoDB;
+let $extra_option=;
+let $save_debug=`select @@debug_dbug`;
+
+if ($MTR_COMBINATION_MYISAM)
+{
+ let $default_engine=MyISAM;
+}
+if ($MTR_COMBINATION_ARIA)
+{
+ let $default_engine=Aria;
+ let $extra_option=transactional=1;
+}
+
+if ($MTR_COMBINATION_STMT)
+{
+ let $binlog_format=include/set_binlog_format_statement.sql;
+}
+if ($MTR_COMBINATION_ROW)
+{
+ let $binlog_format=include/set_binlog_format_row.sql;
+}
+
+--disable_query_log
+--eval set @@default_storage_engine=$default_engine
+--enable_query_log
+
+--echo # Crash recovery
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+let $crash_count= 14;
+let $crash_points='crash_create_before_create_frm',
+ 'crash_alter_partition_after_create_frm',
+ 'crash_alter_partition_after_write_frm',
+ 'crash_convert_partition_1',
+ 'crash_convert_partition_2',
+ 'crash_convert_partition_3',
+ 'crash_convert_partition_4',
+ 'crash_convert_partition_5',
+ 'crash_convert_partition_6',
+ 'crash_convert_partition_7',
+ 'crash_convert_partition_8',
+ 'crash_convert_partition_9',
+ 'crash_convert_partition_10',
+ 'crash_convert_partition_11';
+
+#let $crash_count= 1;
+#let $crash_points= 'crash_convert_partition_10';
+
+let $statement_count= 2;
+let $statements= 'ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1',
+ 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)';
+
+#let $statement_count= 1;
+#let $statements= 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)';
+
+--delimiter $
+create or replace procedure prepare_table(r int)
+begin
+ create or replace table t1 (x int)
+ with system versioning
+ partition by range(x) (
+ partition p0 values less than (10),
+ partition p1 values less than (20),
+ partition pn values less than (30));
+ insert into t1 values (2), (12), (22);
+
+ if r > 1 then
+ create or replace table tp2 (x int)
+ with system versioning;
+ insert into tp2 values (32), (39);
+ end if;
+
+ flush tables;
+end $
+--delimiter ;
+
+let $old_debug=`select @@debug_dbug`;
+
+let $keep_include_silent=1;
+let $grep_script=ALTER;
+--disable_query_log
+
+let $r=0;
+while ($r < $statement_count)
+{
+ inc $r;
+ let $statement=`select ELT($r, $statements)`;
+ --echo # QUERY: $statement
+
+ let $c=0;
+ while ($c < $crash_count)
+ {
+ inc $c;
+ let $crash=`select ELT($c, $crash_points)`;
+
+ --eval set @@default_storage_engine=$default_engine
+ eval call prepare_table($r);
+ if (!$c)
+ {
+ lock tables t1 write;
+ }
+
+ --source $binlog_format
+
+ RESET MASTER;
+ --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+ --disable_reconnect
+ --eval set @@debug_dbug="+d,$crash"
+ let $errno=0;
+ --error 0,2013
+ --eval $statement;
+ let $error=$errno;
+ --enable_reconnect
+ --source include/wait_until_connected_again.inc
+ --disable_query_log
+ --eval set @@debug_dbug="$old_debug"
+
+ if ($error == 0)
+ {
+ --echo # NO CRASH: $crash
+ }
+ if ($error)
+ {
+ --echo # CRASH: $crash
+ }
+ # Check which tables still exists
+ --replace_result MAI MYI MAD MYD
+ --list_files $MYSQLD_DATADIR/test t*
+ --replace_regex /backup-\d+/backup/
+ --list_files $MYSQLD_DATADIR/test *sql*
+ --remove_files_wildcard $MYSQLD_DATADIR/test *sql-backup-*
+
+ --let $binlog_file=master-bin.000001
+ --source include/show_binlog_events.inc
+ if ($error)
+ {
+ --let $binlog_file=master-bin.000002
+ --source include/show_binlog_events.inc
+ }
+
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ show create table t1;
+ select * from t1;
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ --error 0, ER_NO_SUCH_TABLE
+ show create table tp1;
+ --error 0, ER_NO_SUCH_TABLE
+ select * from tp1;
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ --error 0, ER_NO_SUCH_TABLE
+ show create table tp2;
+ --error 0, ER_NO_SUCH_TABLE
+ select * from tp2;
+ # Drop the tables. The warnings will show what was dropped
+ --disable_warnings
+ drop table t1;
+ drop table if exists tp1;
+ --enable_warnings
+ }
+}
+drop table if exists t1;
+drop procedure prepare_table;
+--eval set @@debug_dbug="$save_debug"
+
+--enable_query_log
diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_gtid_strict_mode.inc b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_strict_mode.inc
new file mode 100644
index 00000000000..5150e9060b5
--- /dev/null
+++ b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_strict_mode.inc
@@ -0,0 +1,421 @@
+#
+# This file runs test cases for using --gtid-strict-mode with mariadb-binlog to
+# ensure warnings are properly displayed
+#
+# param $is_strict_mode boolean (0 for false, 1 for true) to enable or
+# disable strict mode for GTID processing
+#
+
+--let MYSQLD_DATADIR=`select @@datadir`
+--let OUT_FILE=$MYSQLTEST_VARDIR/tmp/binlog.out
+
+if ($is_strict_mode == 0)
+{
+ --let BINLOG_STRICT_MODE_PARAM=--skip-gtid-strict-mode
+}
+if ($is_strict_mode == 1)
+{
+ --let BINLOG_STRICT_MODE_PARAM=--gtid-strict-mode
+}
+if ($is_verbose == 1)
+{
+ --let BINLOG_STRICT_MODE_PARAM=$BINLOG_STRICT_MODE_PARAM -vvv
+}
+
+--let $log_error_ = $MYSQLTEST_VARDIR/tmp/out.err
+--let SEARCH_FILE=$log_error_
+
+--echo #
+--echo # Test Case 1:
+--echo # Sequential sequence numbers results in no errors or warnings
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 2:
+--echo # A skipped sequence number results in no errors or warnings if all
+--echo # numbers are monotonic (i.e. gaps in sequence number are allowed
+--echo # provided they never decrease)
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 3:
+--echo # A sequence number lower than the last processed value results in a
+--echo # warning or error
+CREATE TABLE t1 (a int);
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 1;
+INSERT INTO t1 values (1);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 4:
+--echo # Skipping a GTID and later receiving it results in a warning or error
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 5:
+--echo # Repeat sequence numbers produce a warning
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 6:
+--echo # Warnings from different domains are all displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t2 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t2 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 7:
+--echo # A decreasing seq_no before a start-position is ignored
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+--let $start_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+
+--echo # GTID-based start-position
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 $BINLOG_STRICT_MODE_PARAM > log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
+--source include/search_pattern_in_file.inc
+
+--echo # Position-based start-position
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=$start_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
+--source include/search_pattern_in_file.inc
+
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 8:
+--echo # A decreasing seq_no inside of a --start/--stop position window is
+--echo # displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+--let $start_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (4);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 6;
+INSERT INTO t1 values (5);
+--let $stop_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+FLUSH LOGS;
+
+--echo # GTID-based window
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 $BINLOG_STRICT_MODE_PARAM > log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+
+--echo # Position-based window
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --stop-position=stop_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=$start_binlog_pos --stop-position=$stop_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 9:
+--echo # Error if --stop-position is not greater than or equal to
+--echo # --start-position
+--echo #
+--echo # Note: Error is only displayed in strict mode, -vvv has no effect here
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=ERROR: Queried GTID range is invalid in strict mode
+--source include/search_pattern_in_file.inc
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=ERROR: Queried GTID range is invalid in strict mode
+--source include/search_pattern_in_file.inc
+RESET MASTER;
+
+--echo #
+--echo # Test Case 10:
+--echo # Strict mode warnings should be independent of --offset option
+--echo # specification
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 11:
+--echo # Strict mode warnings should be independent of --start-timestamp
+--echo # option specification
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+SET timestamp=@a;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+SET timestamp=@a+1;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+SET timestamp=@a+2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+SET timestamp=@a+3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--error $is_strict_mode
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 12:
+--echo # Specifying multiple binary logs with a log-position start should
+--echo # skip GTID state verification
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+--let $b2_start_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+INSERT INTO t2 values (1);
+FLUSH LOGS;
+INSERT INTO t2 values (2);
+FLUSH LOGS;
+--let BINLOG_FILE1= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+# Skip file 2 as input
+--let BINLOG_FILE2= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE2 --start-position=b2_start_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE1 $MYSQLD_DATADIR/$BINLOG_FILE2 --start-position=$b2_start_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # Test Case 13:
+--echo # If multiple binary logs should be specified but a middle log is
+--echo # missing, we should detect that and warn when using -vvv
+
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+FLUSH LOGS;
+INSERT INTO t1 values (1);
+--let $b2_start_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+
+--echo #
+--echo # GLLE from each log for state reference
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 3)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+
+--let BINLOG_FILE1= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+# Skip file 2 as input
+--let BINLOG_FILE3= query_get_value(SHOW BINARY LOGS, Log_name, 3)
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE3 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE1 $MYSQLD_DATADIR/$BINLOG_FILE3 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
+--echo # We should have two warnings about missing data from domains 0 and 1 if
+--echo # -vvv is specified
+--let SEARCH_FILE=$log_error_
+--let SEARCH_PATTERN=WARNING: Binary logs are missing data for domain 0[^\n]+the last seen event was
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=WARNING: Binary logs are missing data for domain 1[^\n]+neither the starting GTID position list nor any processed events
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+RESET MASTER;
+
+--echo #
+--echo # Test Case 14:
+--echo # If a --stop-position GTID occurs before the first specified binlog's
+--echo # GLLE, error
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+FLUSH LOGS;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+
+--echo #
+--echo # GLLE from each log for state reference
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE2 $BINLOG_STRICT_MODE_PARAM --stop-position=0-1-2 2> log_error_ > OUT_FILE
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE2 $BINLOG_STRICT_MODE_PARAM --stop-position=0-1-2 2> $log_error_ > $OUT_FILE
+--let SEARCH_PATTERN=ERROR: --stop-position GTID
+--source include/search_pattern_in_file.inc
+--remove_file $log_error_
+DROP TABLE t1;
+
+--remove_file $OUT_FILE
diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc
new file mode 100644
index 00000000000..2830f3f665d
--- /dev/null
+++ b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc
@@ -0,0 +1,606 @@
+#
+# This file runs test cases for providing GTIDs to --start-position and
+# --stop-position arguments in mariadb-binlog
+#
+# param $is_remote boolean (0 for false, 1 for true) to perform a local file
+# or remote host analysis
+#
+
+--let MYSQLD_DATADIR=`select @@datadir`
+--let data_inconsistent_err= "table data is inconsistent after replaying binlog using GTID start/stop positions";
+--let $tmp_out_ = $MYSQLTEST_VARDIR/tmp/null.log
+
+## Initialize test data
+#
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET timestamp=@a;
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+--let $empty_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+CREATE TABLE t1 (a int);
+SET timestamp=@a+1;
+INSERT INTO t1 values (1), (2);
+--let test2_t1_mid_checksum= `CHECKSUM TABLE t1`
+
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+SET timestamp=@a+2;
+CREATE TABLE t2 (a int);
+SET timestamp=@a+3;
+INSERT INTO t2 values (1);
+--let t2_mid_checksum= `CHECKSUM TABLE t2`
+
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET timestamp=@a+4;
+INSERT INTO t1 values (3), (4);
+--let t1_final_checksum_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
+--let t1_final_checksum= `CHECKSUM TABLE t1`
+
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+INSERT INTO t2 values (2);
+--let test4_t2_good_checksum= `CHECKSUM TABLE t2`
+
+SET @@session.server_id= 3;
+INSERT INTO t2 values (3);
+--let test3_t2_good_checksum= `CHECKSUM TABLE t2`
+
+SET @@session.server_id= 2;
+INSERT INTO t2 values (4);
+--let t2_final_checksum= `CHECKSUM TABLE t2`
+
+FLUSH LOGS;
+
+# Multiple binlog file case, used by test 18
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t3 (a int);
+INSERT INTO t3 VALUES (1);
+--let t3_final_checksum= `CHECKSUM TABLE t3`
+
+FLUSH LOGS;
+
+--echo # Gtid list event of the 2nd binlog file whose content is
+--echo # matched against --start-position in the following tests:
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--source include/show_gtid_list.inc
+--let $binlog_file=
+
+--let BINLOG_FILE= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+--let BINLOG_FILE2= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+
+if ($is_remote == 0)
+{
+ --let BINLOG_FILE_PARAM=$MYSQLD_DATADIR/$BINLOG_FILE.orig
+ --let BINLOG_FILE_PARAM2=$MYSQLD_DATADIR/$BINLOG_FILE2.orig
+}
+if ($is_remote == 1)
+{
+ --let BINLOG_FILE_PARAM= --read-from-remote-server $BINLOG_FILE
+ --let BINLOG_FILE_PARAM2= --read-from-remote-server $BINLOG_FILE2
+}
+
+--copy_file $MYSQLD_DATADIR/$BINLOG_FILE $MYSQLD_DATADIR/$BINLOG_FILE.orig
+--copy_file $MYSQLD_DATADIR/$BINLOG_FILE2 $MYSQLD_DATADIR/$BINLOG_FILE2.orig
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+
+--echo #
+--echo # Test Case 1:
+--echo # The end of the binlog file resets the server and domain id of the
+--echo # session
+
+# As gtid_domain_id and server_id should not change after reading binlog in GTID
+# mode, change variables to otherwise-unused values to ensure they remain
+--let $reset_gtid_domain_id = `select @@session.gtid_domain_id`
+--let $reset_server_id = `select @@session.server_id`
+SET @@session.gtid_domain_id= 10;
+SET @@session.server_id= 20;
+
+# Replay the binlog
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | $MYSQL
+--let $test_gtid_domain_id = `select @@session.gtid_domain_id`
+
+# Ensure variables haven't changed
+--let $assert_text = session gtid_domain_id should not change when reading binlog in GTID mode
+--let $assert_cond = @@session.gtid_domain_id = 10
+--source include/assert.inc
+--let $assert_text = session server_id should not change when reading binlog in GTID mode
+--let $assert_cond = @@session.server_id = 20
+--source include/assert.inc
+
+# Reset back to previous state
+--eval SET @@session.gtid_domain_id= $reset_gtid_domain_id
+--eval SET @@session.server_id= $reset_server_id
+DROP TABLE t1;
+
+
+--echo #
+--echo # Test Case 2:
+--echo # Single GTID range specified
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | $MYSQL
+
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+
+
+--echo #
+--echo # Test Case 3:
+--echo # Single GTID range with different server_ids
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-0 --stop-position=1-3-4 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=1-2-0 --stop-position=1-3-4 | $MYSQL
+
+if ($test3_t2_good_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude domain 0 from stop position";
+}
+DROP TABLE t2;
+
+
+--echo #
+--echo # Test Case 4:
+--echo # Multiple GTID ranges specified
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 --stop-position=0-1-3,1-2-3 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 --stop-position=0-1-3,1-2-3 | $MYSQL
+
+# Reuse checksum spot from test 4
+if ($t1_final_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if ($test4_t2_good_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # Test Case 5:
+--echo # Multiple GTID ranges specified where the domain ids are listed in
+--echo # different orders between start/stop position
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-3,1-2-3 --start-position=1-2-0,0-1-0 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=0-1-3,1-2-3 --start-position=1-2-0,0-1-0 | $MYSQL
+
+# Reuse checksum spot from test 4
+if ($t1_final_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if ($test4_t2_good_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # Test Case 6:
+--echo # Only start position specified
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (3), (4);
+--let test6_t1_mid_checksum= `CHECKSUM TABLE t1`
+DROP TABLE t1;
+CREATE TABLE t1 (a int);
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-2 | $MYSQL
+if ($test6_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if ($t2_final_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # Test Case 7:
+--echo # Only stop position specified
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=0-1-2 | $MYSQL
+
+# Reuse checksum spot from test 2
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+
+
+--echo #
+--echo # Test Case 8:
+--echo # Seq_no=0 in --start-position includes all events for a domain
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 | $MYSQL
+if ($t1_final_checksum != `CHECKSUM TABLE t1`)
+{
+ die "t1 data should be complete as binlog replay should include domain 0 entirely in results";
+}
+if ($t2_final_checksum != `CHECKSUM TABLE t2`)
+{
+ die "t2 data should be complete as binlog replay should include domain 1 entirely in results";
+}
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # Test Case 9:
+--echo # Seq_no=0 in --stop-position excludes all events for a domain
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-0,1-2-0 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=0-1-0,1-2-0 | $MYSQL
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude domain 0 from results";
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from results";
+}
+
+--echo #
+--echo # Test Case 10:
+--echo # Output stops for all domain ids when all --stop-position GTID values
+--echo # have been hit.
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=0-1-2 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from results";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 11:
+--echo # All GTID events from other domains are printed until the
+--echo # --stop-position values are hit
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=1-3-4 | $MYSQL
+if ($test3_t2_good_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude domain 0 from stop position";
+}
+DROP TABLE t2;
+
+--echo #
+--echo # Test Case 12:
+--echo # Scalar and GTID values can be used together for stop or start
+--echo # position
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=empty_binlog_pos --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=$empty_binlog_pos --stop-position=0-1-2 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=t1_final_checksum_pos | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=$t1_final_checksum_pos | $MYSQL
+if ($t1_final_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if ($t2_mid_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # Test Case 13:
+--echo # If the start position is delayed within the binlog, events occurring
+--echo # before that position are ignored
+CREATE TABLE t1 (a int);
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-1 --stop-position=0-1-2 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from results";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 14:
+--echo # If start position is repeated, the last specification overrides all
+--echo # previous ones
+CREATE TABLE t1 (a int);
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --start-position=0-1-1 --stop-position=0-1-2 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from results";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 15:
+--echo # If stop position is repeated, the last specification overrides all
+--echo # previous ones
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-1 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-1 --stop-position=0-1-2 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from results";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 16:
+--echo # Start position with --offset=<n> skips n events after the first
+--echo # GTID is found
+
+# t1 needs to be specified because its creation should be skipped from
+# --offset specification
+CREATE TABLE t1 (a int);
+
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 --offset=5 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 --offset=5 | $MYSQL
+if ($test2_t1_mid_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude events after GTID 0-1-2";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 17:
+--echo # Start position with --start-datetime=<T> where T occurs after the
+--echo # specified GTID results in no events before T
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=1-2-2 --start-datetime="1970-01-21 15:32:24" | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=1-2-2 --start-datetime="1970-01-21 15:32:24" | $MYSQL
+if ($t2_mid_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude events before the given start-datetime";
+}
+DROP TABLE t2;
+
+--echo #
+--echo # Test Case 18:
+--echo # If --stop-position is specified, domains which are not present
+--echo # in its list should be excluded from output
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --stop-position=1-3-4 | $MYSQL
+
+if ($test3_t2_good_checksum != `CHECKSUM TABLE t2`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude domain 0 from stop position";
+}
+DROP TABLE t2;
+
+--echo #
+--echo # Test Case 19:
+--echo # If the start and stop GTIDs in any domain are equal, the domain
+--echo # should not have any output
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 --stop-position=0-1-2 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=0-1-2 --stop-position=0-1-2 | $MYSQL
+
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should exclude domain 0 from stop position";
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from stop position";
+}
+
+--echo #
+--echo # Test Case 20:
+--echo # If --start-position and --stop-position have different domain ids,
+--echo # only events from GTIDs in the --stop-position list are output
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-2 --stop-position=0-1-3 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM --start-position=1-2-2 --stop-position=0-1-3 | $MYSQL
+if ($t1_final_checksum != `CHECKSUM TABLE t1`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should exclude domain 1 from stop position";
+}
+DROP TABLE t1;
+
+--echo #
+--echo # Test Case 21:
+--echo # Successive binary logs (e.g. logs with previous logs that have been
+--echo # purged) will write events when the --start-position matches their
+--echo # Gtid_list_log_event state
+if ($is_remote == 1)
+{
+ --echo #
+ --echo # Reset server state
+ RESET MASTER;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE.orig | $MYSQL
+ FLUSH LOGS;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE2.orig | $MYSQL
+ FLUSH LOGS;
+ --eval PURGE BINARY LOGS TO "$BINLOG_FILE2"
+ DROP TABLE t1;
+ DROP TABLE t2;
+ DROP TABLE t3;
+}
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3,1-2-5 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-3,1-2-5 | $MYSQL
+if ($t3_final_checksum != `CHECKSUM TABLE t3`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should not have any events from unspecified binlog file";
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should not have any events from unspecified binlog file";
+}
+DROP TABLE t3;
+
+--echo #
+--echo # Test Case 22:
+--echo # Successive binary logs can be called with --stop-position and
+--echo # without --start-position
+if ($is_remote == 1)
+{
+ --echo #
+ --echo # Reset server state
+ RESET MASTER;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE.orig | $MYSQL
+ FLUSH LOGS;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE2.orig | $MYSQL
+ FLUSH LOGS;
+ --eval PURGE BINARY LOGS TO "$BINLOG_FILE2"
+ DROP TABLE t1;
+ DROP TABLE t2;
+ DROP TABLE t3;
+}
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --stop-position=0-1-4 | MYSQL
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --stop-position=0-1-4 | $MYSQL
+if (`SELECT COUNT(*) FROM test.t3`)
+{
+ die $data_inconsistent_err;
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't1'`)
+{
+ die "t1 should not exist as binlog replay should not have any events from unspecified binlog file";
+}
+if (`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`)
+{
+ die "t2 should not exist as binlog replay should not have any events from unspecified binlog file";
+}
+DROP TABLE t3;
+
+
+if ($is_remote == 1)
+{
+ --echo #
+ --echo # Remote-only setup for error cases
+ RESET MASTER;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE.orig | $MYSQL
+ FLUSH LOGS;
+ --exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE2.orig | $MYSQL
+ FLUSH LOGS;
+ --eval PURGE BINARY LOGS TO "$BINLOG_FILE2"
+}
+
+--echo # At the following error cases analysis
+--echo # note incompatible --start-position with the value of
+--echo # Gtid list event of the 2nd binlog file printed above.
+
+--let err_out_= $MYSQLTEST_VARDIR/tmp/err.out
+--let SEARCH_FILE=$err_out_
+
+--echo #
+--echo # Error Case 1:
+--echo # A GTID --start-position that does not mention all domains that make
+--echo # up the binary log state should error
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_
+--error 1
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-3 > $tmp_out_ 2> $err_out_
+if ($is_remote == 1)
+{
+ --let SEARCH_PATTERN=ERROR: Got error reading packet from server
+}
+if ($is_remote == 0)
+{
+ --let SEARCH_PATTERN=ERROR: Starting GTID position list does not specify an initial value
+}
+--source include/search_pattern_in_file.inc
+--remove_file $err_out_
+
+--echo #
+--echo # Error Case 2:
+--echo # A GTID --start-position with any sequence numbers which occur before
+--echo # the binary log state should result in error
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_
+--error 1
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > $tmp_out_ 2> $err_out_
+if ($is_remote == 1)
+{
+ --let SEARCH_PATTERN=ERROR: Got error reading packet from server
+}
+if ($is_remote == 0)
+{
+ --let SEARCH_PATTERN=ERROR: Binary logs are missing data for domain 0
+}
+--source include/search_pattern_in_file.inc
+--remove_file $err_out_
+
+--echo #
+--echo # Error Case 3:
+--echo # A GTID --start-position with any sequence numbers that are not
+--echo # eventually processed results in error
+--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_
+--error 1
+--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > $tmp_out_ 2> $err_out_
+if ($is_remote == 1)
+{
+ --let SEARCH_PATTERN=ERROR: Got error reading packet from server
+}
+if ($is_remote == 0)
+{
+ --let SEARCH_PATTERN=ERROR: Binary logs never reached expected GTID state
+}
+--source include/search_pattern_in_file.inc
+--remove_file $err_out_
+
+if ($is_remote == 1)
+{
+ --echo #
+ --echo # Remote-only cleanup from error cases
+ DROP TABLE t1;
+ DROP TABLE t2;
+ DROP TABLE t3;
+ RESET MASTER;
+}
+
+--remove_file $MYSQLD_DATADIR/$BINLOG_FILE.orig
+--remove_file $MYSQLD_DATADIR/$BINLOG_FILE2.orig
+--remove_file $tmp_out_
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_glle_ordered.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_glle_ordered.result
new file mode 100644
index 00000000000..2826cba99ae
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_glle_ordered.result
@@ -0,0 +1,19 @@
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.server_id= 1;
+INSERT INTO t2 VALUES (1);
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > SEARCH_FILE
+FOUND 1 /Gtid list \[0-1-1,\n# 1-2-1,\n# 1-1-2,\n# 2-3-1\]/ in tmp_binlog.out
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_strict_mode.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_strict_mode.result
new file mode 100644
index 00000000000..c2f7bac387c
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_strict_mode.result
@@ -0,0 +1,925 @@
+###############################
+# Test Setup
+###############################
+RESET MASTER;
+####################################################
+# Test Case Group 1
+#
+# Tests with --gtid-strict-mode should error and
+# immediately quit with error on out of order GTIDs
+####################################################
+#
+# Test Case 1:
+# Sequential sequence numbers results in no errors or warnings
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 2:
+# A skipped sequence number results in no errors or warnings if all
+# numbers are monotonic (i.e. gaps in sequence number are allowed
+# provided they never decrease)
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 3:
+# A sequence number lower than the last processed value results in a
+# warning or error
+CREATE TABLE t1 (a int);
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 1;
+INSERT INTO t1 values (1);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 4:
+# Skipping a GTID and later receiving it results in a warning or error
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 5:
+# Repeat sequence numbers produce a warning
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 6:
+# Warnings from different domains are all displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t2 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t2 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
+#
+# Test Case 7:
+# A decreasing seq_no before a start-position is ignored
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 --gtid-strict-mode > log_error_ > OUT_FILE
+NOT FOUND /ERROR/ in out.err
+# Position-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 8:
+# A decreasing seq_no inside of a --start/--stop position window is
+# displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (4);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 6;
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 --gtid-strict-mode > log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+# Position-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --stop-position=stop_binlog_pos --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 9:
+# Error if --stop-position is not greater than or equal to
+# --start-position
+#
+# Note: Error is only displayed in strict mode, -vvv has no effect here
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+RESET MASTER;
+#
+# Test Case 10:
+# Strict mode warnings should be independent of --offset option
+# specification
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 11:
+# Strict mode warnings should be independent of --start-timestamp
+# option specification
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+SET timestamp=@a;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+SET timestamp=@a+1;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+SET timestamp=@a+2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+SET timestamp=@a+3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" --gtid-strict-mode 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 12:
+# Specifying multiple binary logs with a log-position start should
+# skip GTID state verification
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+INSERT INTO t2 values (1);
+FLUSH LOGS;
+INSERT INTO t2 values (2);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE2 --start-position=b2_start_pos --gtid-strict-mode 2> log_error_ > OUT_FILE
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 13:
+# If multiple binary logs should be specified but a middle log is
+# missing, we should detect that and warn when using -vvv
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+FLUSH LOGS;
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-1]
+show binlog events in 'master-bin.000003' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Gtid_list 1 # [0-1-2,1-2-1]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE3 --gtid-strict-mode 2> log_error_ > OUT_FILE
+# We should have two warnings about missing data from domains 0 and 1 if
+# -vvv is specified
+NOT FOUND /WARNING: Binary logs are missing data for domain 0[^\n]+the last seen event was/ in out.err
+NOT FOUND /WARNING: Binary logs are missing data for domain 1[^\n]+neither the starting GTID position list nor any processed events/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+RESET MASTER;
+#
+# Test Case 14:
+# If a --stop-position GTID occurs before the first specified binlog's
+# GLLE, error
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+FLUSH LOGS;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-3]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE2 --gtid-strict-mode --stop-position=0-1-2 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: --stop-position GTID/ in out.err
+DROP TABLE t1;
+####################################################
+# Test Case Group 2
+#
+# Test cases with --skip-gtid-strict-mode -vvv
+# should not quit early or with error when
+# encountering out of order GTIDs; however should
+# produce warnings after binlog processing
+####################################################
+#
+# Test Case 1:
+# Sequential sequence numbers results in no errors or warnings
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+NOT FOUND /WARNING/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 2:
+# A skipped sequence number results in no errors or warnings if all
+# numbers are monotonic (i.e. gaps in sequence number are allowed
+# provided they never decrease)
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+NOT FOUND /WARNING/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 3:
+# A sequence number lower than the last processed value results in a
+# warning or error
+CREATE TABLE t1 (a int);
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 1;
+INSERT INTO t1 values (1);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 4:
+# Skipping a GTID and later receiving it results in a warning or error
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 5:
+# Repeat sequence numbers produce a warning
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 6:
+# Warnings from different domains are all displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t2 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t2 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 2 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
+#
+# Test Case 7:
+# A decreasing seq_no before a start-position is ignored
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 --skip-gtid-strict-mode -vvv > log_error_ > OUT_FILE
+NOT FOUND /WARNING/ in out.err
+# Position-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+NOT FOUND /WARNING/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 8:
+# A decreasing seq_no inside of a --start/--stop position window is
+# displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (4);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 6;
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 --skip-gtid-strict-mode -vvv > log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+# Position-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --stop-position=stop_binlog_pos --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 9:
+# Error if --stop-position is not greater than or equal to
+# --start-position
+#
+# Note: Error is only displayed in strict mode, -vvv has no effect here
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+RESET MASTER;
+#
+# Test Case 10:
+# Strict mode warnings should be independent of --offset option
+# specification
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 11:
+# Strict mode warnings should be independent of --start-timestamp
+# option specification
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+SET timestamp=@a;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+SET timestamp=@a+1;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+SET timestamp=@a+2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+SET timestamp=@a+3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+FOUND 1 /WARNING: Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 12:
+# Specifying multiple binary logs with a log-position start should
+# skip GTID state verification
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+INSERT INTO t2 values (1);
+FLUSH LOGS;
+INSERT INTO t2 values (2);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE2 --start-position=b2_start_pos --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 13:
+# If multiple binary logs should be specified but a middle log is
+# missing, we should detect that and warn when using -vvv
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+FLUSH LOGS;
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-1]
+show binlog events in 'master-bin.000003' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Gtid_list 1 # [0-1-2,1-2-1]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE3 --skip-gtid-strict-mode -vvv 2> log_error_ > OUT_FILE
+# We should have two warnings about missing data from domains 0 and 1 if
+# -vvv is specified
+FOUND 1 /WARNING: Binary logs are missing data for domain 0[^\n]+the last seen event was/ in out.err
+FOUND 1 /WARNING: Binary logs are missing data for domain 1[^\n]+neither the starting GTID position list nor any processed events/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+RESET MASTER;
+#
+# Test Case 14:
+# If a --stop-position GTID occurs before the first specified binlog's
+# GLLE, error
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+FLUSH LOGS;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-3]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE2 --skip-gtid-strict-mode -vvv --stop-position=0-1-2 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: --stop-position GTID/ in out.err
+DROP TABLE t1;
+####################################################
+# Test Case Group 3
+#
+# Run test cases with --skip-gtid-strict-mode should
+# neither produce errors nor warnings when
+# encountering out of order GTIDs
+####################################################
+#
+# Test Case 1:
+# Sequential sequence numbers results in no errors or warnings
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING)/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 2:
+# A skipped sequence number results in no errors or warnings if all
+# numbers are monotonic (i.e. gaps in sequence number are allowed
+# provided they never decrease)
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING)/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 3:
+# A sequence number lower than the last processed value results in a
+# warning or error
+CREATE TABLE t1 (a int);
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 1;
+INSERT INTO t1 values (1);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 4:
+# Skipping a GTID and later receiving it results in a warning or error
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 5:
+# Repeat sequence numbers produce a warning
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 6:
+# Warnings from different domains are all displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t2 values (2);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t2 values (3);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+RESET MASTER;
+#
+# Test Case 7:
+# A decreasing seq_no before a start-position is ignored
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (4);
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 --skip-gtid-strict-mode > log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING)/ in out.err
+# Position-based start-position
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING)/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 8:
+# A decreasing seq_no inside of a --start/--stop position window is
+# displayed
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 5;
+INSERT INTO t1 values (4);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+SET @@session.gtid_seq_no= 6;
+INSERT INTO t1 values (5);
+FLUSH LOGS;
+# GTID-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 --skip-gtid-strict-mode > log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+# Position-based window
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --stop-position=stop_binlog_pos --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 9:
+# Error if --stop-position is not greater than or equal to
+# --start-position
+#
+# Note: Error is only displayed in strict mode, -vvv has no effect here
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /ERROR: Queried GTID range is invalid in strict mode/ in out.err
+RESET MASTER;
+#
+# Test Case 10:
+# Strict mode warnings should be independent of --offset option
+# specification
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 11:
+# Strict mode warnings should be independent of --start-timestamp
+# option specification
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET @@session.gtid_seq_no= 1;
+SET timestamp=@a;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_seq_no= 3;
+SET timestamp=@a+1;
+INSERT INTO t1 values (1);
+SET @@session.gtid_seq_no= 2;
+SET timestamp=@a+2;
+INSERT INTO t1 values (2);
+SET @@session.gtid_seq_no= 4;
+SET timestamp=@a+3;
+INSERT INTO t1 values (3);
+INSERT INTO t1 values (4);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+NOT FOUND /(ERROR|WARNING): Found out of order GTID/ in out.err
+DROP TABLE t1;
+RESET MASTER;
+#
+# Test Case 12:
+# Specifying multiple binary logs with a log-position start should
+# skip GTID state verification
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+INSERT INTO t2 values (1);
+FLUSH LOGS;
+INSERT INTO t2 values (2);
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE2 --start-position=b2_start_pos --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 13:
+# If multiple binary logs should be specified but a middle log is
+# missing, we should detect that and warn when using -vvv
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+FLUSH LOGS;
+INSERT INTO t1 values (1);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-1]
+show binlog events in 'master-bin.000003' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000003 # Gtid_list 1 # [0-1-2,1-2-1]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE3 --skip-gtid-strict-mode 2> log_error_ > OUT_FILE
+# We should have two warnings about missing data from domains 0 and 1 if
+# -vvv is specified
+NOT FOUND /WARNING: Binary logs are missing data for domain 0[^\n]+the last seen event was/ in out.err
+NOT FOUND /WARNING: Binary logs are missing data for domain 1[^\n]+neither the starting GTID position list nor any processed events/ in out.err
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+RESET MASTER;
+#
+# Test Case 14:
+# If a --stop-position GTID occurs before the first specified binlog's
+# GLLE, error
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+FLUSH LOGS;
+INSERT INTO t1 values (3);
+FLUSH LOGS;
+#
+# GLLE from each log for state reference
+show binlog events in 'master-bin.000001' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-3]
+# MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE2 --skip-gtid-strict-mode --stop-position=0-1-2 2> log_error_ > OUT_FILE
+FOUND 1 /ERROR: --stop-position GTID/ in out.err
+DROP TABLE t1;
+##############################
+# Cleanup
+##############################
+SET @@global.gtid_domain_id= 0;
+SET @@global.server_id= 1;
+End of the tests
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result
new file mode 100644
index 00000000000..fce5f95ce82
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result
@@ -0,0 +1,468 @@
+###############################
+# Test Setup
+###############################
+RESET MASTER;
+######################################
+# Test Group 1
+# Run test cases on local log file
+######################################
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET timestamp=@a;
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET timestamp=@a+1;
+INSERT INTO t1 values (1), (2);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+SET timestamp=@a+2;
+CREATE TABLE t2 (a int);
+SET timestamp=@a+3;
+INSERT INTO t2 values (1);
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET timestamp=@a+4;
+INSERT INTO t1 values (3), (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+INSERT INTO t2 values (2);
+SET @@session.server_id= 3;
+INSERT INTO t2 values (3);
+SET @@session.server_id= 2;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t3 (a int);
+INSERT INTO t3 VALUES (1);
+FLUSH LOGS;
+# Gtid list event of the 2nd binlog file whose content is
+# matched against --start-position in the following tests:
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-3,1-3-4,1-2-5]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+#
+# Test Case 1:
+# The end of the binlog file resets the server and domain id of the
+# session
+SET @@session.gtid_domain_id= 10;
+SET @@session.server_id= 20;
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+include/assert.inc [session gtid_domain_id should not change when reading binlog in GTID mode]
+include/assert.inc [session server_id should not change when reading binlog in GTID mode]
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+DROP TABLE t1;
+#
+# Test Case 2:
+# Single GTID range specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 3:
+# Single GTID range with different server_ids
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-0 --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 4:
+# Multiple GTID ranges specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 --stop-position=0-1-3,1-2-3 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 5:
+# Multiple GTID ranges specified where the domain ids are listed in
+# different orders between start/stop position
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-3,1-2-3 --start-position=1-2-0,0-1-0 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 6:
+# Only start position specified
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (3), (4);
+DROP TABLE t1;
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 7:
+# Only stop position specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 8:
+# Seq_no=0 in --start-position includes all events for a domain
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 9:
+# Seq_no=0 in --stop-position excludes all events for a domain
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-0,1-2-0 | MYSQL
+#
+# Test Case 10:
+# Output stops for all domain ids when all --stop-position GTID values
+# have been hit.
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 11:
+# All GTID events from other domains are printed until the
+# --stop-position values are hit
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 12:
+# Scalar and GTID values can be used together for stop or start
+# position
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=empty_binlog_pos --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=t1_final_checksum_pos | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 13:
+# If the start position is delayed within the binlog, events occurring
+# before that position are ignored
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 14:
+# If start position is repeated, the last specification overrides all
+# previous ones
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 15:
+# If stop position is repeated, the last specification overrides all
+# previous ones
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 16:
+# Start position with --offset=<n> skips n events after the first
+# GTID is found
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 --offset=5 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 17:
+# Start position with --start-datetime=<T> where T occurs after the
+# specified GTID results in no events before T
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=1-2-2 --start-datetime="1970-01-21 15:32:24" | MYSQL
+DROP TABLE t2;
+#
+# Test Case 18:
+# If --stop-position is specified, domains which are not present
+# in its list should be excluded from output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 19:
+# If the start and stop GTIDs in any domain are equal, the domain
+# should not have any output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 --stop-position=0-1-2 | MYSQL
+#
+# Test Case 20:
+# If --start-position and --stop-position have different domain ids,
+# only events from GTIDs in the --stop-position list are output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-2 --stop-position=0-1-3 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 21:
+# Successive binary logs (e.g. logs with previous logs that have been
+# purged) will write events when the --start-position matches their
+# Gtid_list_log_event state
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3,1-2-5 | MYSQL
+DROP TABLE t3;
+#
+# Test Case 22:
+# Successive binary logs can be called with --stop-position and
+# without --start-position
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --stop-position=0-1-4 | MYSQL
+DROP TABLE t3;
+# At the following error cases analysis
+# note incompatible --start-position with the value of
+# Gtid list event of the 2nd binlog file printed above.
+#
+# Error Case 1:
+# A GTID --start-position that does not mention all domains that make
+# up the binary log state should error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_
+FOUND 2 /ERROR: Starting GTID position list does not specify an initial value/ in err.out
+#
+# Error Case 2:
+# A GTID --start-position with any sequence numbers which occur before
+# the binary log state should result in error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_
+FOUND 1 /ERROR: Binary logs are missing data for domain 0/ in err.out
+#
+# Error Case 3:
+# A GTID --start-position with any sequence numbers that are not
+# eventually processed results in error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_
+FOUND 2 /ERROR: Binary logs never reached expected GTID state/ in err.out
+######################################
+# Test Group 2
+# Run test cases on remote host
+######################################
+set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
+SET timestamp=@a;
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET timestamp=@a+1;
+INSERT INTO t1 values (1), (2);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+SET timestamp=@a+2;
+CREATE TABLE t2 (a int);
+SET timestamp=@a+3;
+INSERT INTO t2 values (1);
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+SET timestamp=@a+4;
+INSERT INTO t1 values (3), (4);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+INSERT INTO t2 values (2);
+SET @@session.server_id= 3;
+INSERT INTO t2 values (3);
+SET @@session.server_id= 2;
+INSERT INTO t2 values (4);
+FLUSH LOGS;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t3 (a int);
+INSERT INTO t3 VALUES (1);
+FLUSH LOGS;
+# Gtid list event of the 2nd binlog file whose content is
+# matched against --start-position in the following tests:
+show binlog events in 'master-bin.000002' limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid_list 1 # [0-1-3,1-3-4,1-2-5]
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+#
+# Test Case 1:
+# The end of the binlog file resets the server and domain id of the
+# session
+SET @@session.gtid_domain_id= 10;
+SET @@session.server_id= 20;
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+include/assert.inc [session gtid_domain_id should not change when reading binlog in GTID mode]
+include/assert.inc [session server_id should not change when reading binlog in GTID mode]
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+DROP TABLE t1;
+#
+# Test Case 2:
+# Single GTID range specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 3:
+# Single GTID range with different server_ids
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-0 --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 4:
+# Multiple GTID ranges specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 --stop-position=0-1-3,1-2-3 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 5:
+# Multiple GTID ranges specified where the domain ids are listed in
+# different orders between start/stop position
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-3,1-2-3 --start-position=1-2-0,0-1-0 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 6:
+# Only start position specified
+CREATE TABLE t1 (a int);
+INSERT INTO t1 values (3), (4);
+DROP TABLE t1;
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 7:
+# Only stop position specified
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 8:
+# Seq_no=0 in --start-position includes all events for a domain
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0,1-2-0 | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 9:
+# Seq_no=0 in --stop-position excludes all events for a domain
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-0,1-2-0 | MYSQL
+#
+# Test Case 10:
+# Output stops for all domain ids when all --stop-position GTID values
+# have been hit.
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 11:
+# All GTID events from other domains are printed until the
+# --stop-position values are hit
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 12:
+# Scalar and GTID values can be used together for stop or start
+# position
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=empty_binlog_pos --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=t1_final_checksum_pos | MYSQL
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# Test Case 13:
+# If the start position is delayed within the binlog, events occurring
+# before that position are ignored
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 14:
+# If start position is repeated, the last specification overrides all
+# previous ones
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --start-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 15:
+# If stop position is repeated, the last specification overrides all
+# previous ones
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-1 --stop-position=0-1-2 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 16:
+# Start position with --offset=<n> skips n events after the first
+# GTID is found
+CREATE TABLE t1 (a int);
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=0-1-2 --offset=5 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 17:
+# Start position with --start-datetime=<T> where T occurs after the
+# specified GTID results in no events before T
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-0 --stop-position=1-2-2 --start-datetime="1970-01-21 15:32:24" | MYSQL
+DROP TABLE t2;
+#
+# Test Case 18:
+# If --stop-position is specified, domains which are not present
+# in its list should be excluded from output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --stop-position=1-3-4 | MYSQL
+DROP TABLE t2;
+#
+# Test Case 19:
+# If the start and stop GTIDs in any domain are equal, the domain
+# should not have any output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=0-1-2 --stop-position=0-1-2 | MYSQL
+#
+# Test Case 20:
+# If --start-position and --stop-position have different domain ids,
+# only events from GTIDs in the --stop-position list are output
+# MYSQL_BINLOG BINLOG_FILE_PARAM --start-position=1-2-2 --stop-position=0-1-3 | MYSQL
+DROP TABLE t1;
+#
+# Test Case 21:
+# Successive binary logs (e.g. logs with previous logs that have been
+# purged) will write events when the --start-position matches their
+# Gtid_list_log_event state
+#
+# Reset server state
+RESET MASTER;
+FLUSH LOGS;
+FLUSH LOGS;
+PURGE BINARY LOGS TO "master-bin.000002";
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3,1-2-5 | MYSQL
+DROP TABLE t3;
+#
+# Test Case 22:
+# Successive binary logs can be called with --stop-position and
+# without --start-position
+#
+# Reset server state
+RESET MASTER;
+FLUSH LOGS;
+FLUSH LOGS;
+PURGE BINARY LOGS TO "master-bin.000002";
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --stop-position=0-1-4 | MYSQL
+DROP TABLE t3;
+#
+# Remote-only setup for error cases
+RESET MASTER;
+FLUSH LOGS;
+FLUSH LOGS;
+PURGE BINARY LOGS TO "master-bin.000002";
+# At the following error cases analysis
+# note incompatible --start-position with the value of
+# Gtid list event of the 2nd binlog file printed above.
+#
+# Error Case 1:
+# A GTID --start-position that does not mention all domains that make
+# up the binary log state should error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_
+FOUND 1 /ERROR: Got error reading packet from server/ in err.out
+#
+# Error Case 2:
+# A GTID --start-position with any sequence numbers which occur before
+# the binary log state should result in error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_
+FOUND 1 /ERROR: Got error reading packet from server/ in err.out
+#
+# Error Case 3:
+# A GTID --start-position with any sequence numbers that are not
+# eventually processed results in error
+# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_
+FOUND 1 /ERROR: Got error reading packet from server/ in err.out
+#
+# Remote-only cleanup from error cases
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+RESET MASTER;
+#
+# Error Case 4:
+# User provides invalid positions
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=z
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-2
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-2-
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=-1
+#
+# Error Case 5:
+# User provides GTID ranges with repeated domain ids
+# MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1,0-1-8 --stop-position=0-1-4,0-1-12
+##############################
+# Cleanup
+##############################
+SET @@global.gtid_domain_id= 0;
+SET @@global.server_id= 1;
+# End of the tests
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_alter_verbose.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_alter_verbose.result
new file mode 100644
index 00000000000..b6b67bc1380
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_alter_verbose.result
@@ -0,0 +1,15 @@
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+RESET MASTER;
+create table myt (a int) engine=InnoDB;
+alter table myt add column (b int);
+FLUSH LOGS;
+# Exec MYSQL_BINLOG --base64-output=decode-rows -v MYSQLD_DATADIR/BINLOG_FILENAME > MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
+Verbose statements from : master-bin.000001
+select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
+stmt
+### alter table myt add column (b int)
+### alter table myt add column (b int)
+drop table raw_binlog_rows;
+drop table myt;
+set global binlog_alter_two_phase=0;
diff --git a/mysql-test/suite/binlog/r/start_alter_mysqlbinlog_replay.result b/mysql-test/suite/binlog/r/start_alter_mysqlbinlog_replay.result
new file mode 100644
index 00000000000..14bc2d3bf78
--- /dev/null
+++ b/mysql-test/suite/binlog/r/start_alter_mysqlbinlog_replay.result
@@ -0,0 +1,42 @@
+#
+# Test verifies replay of binary logs which contain
+# SA/RA/CA works fine.
+# Generate a binary log with alter events and use mysqlbinlog tool to
+# generate a sql file for replay. Source it on an clean master and
+# verify the correctness. Use the latest binlog and repeat the same
+# process mentioned above and observe replay works fine.
+#
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+create table t1 (f1 int primary key) engine=InnoDB;
+create table t2 (f1 int primary key, constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
+drop table t2, t1;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-5
+FLUSH LOGS;
+# reset the binlog
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-5
+FLUSH LOGS;
+# Replay 1: One more time to simulate S->S case
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-5
+FLUSH LOGS;
+# Replay 2: One more time to simulate S->S case
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-5
+# clean up
+RESET MASTER;
+set global binlog_alter_two_phase=0;
diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test
index 153dcdd155a..5f372e6d5fd 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
@@ -180,7 +180,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET @old_flush = @@GLOBAL.innodb_flush_log_at_trx_commit;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
---let $syncs1 = query_get_value(SHOW STATUS LIKE 'Innodb_os_log_fsyncs', Value, 1)
+--let $syncs1 = query_get_value(SHOW STATUS LIKE 'Innodb_data_fsyncs', Value, 1)
--let $ROWS = 100
--disable_query_log
let $count = $ROWS;
@@ -188,7 +188,7 @@ while ($count) {
eval INSERT INTO t1 VALUES ($count);
dec $count;
}
---let $syncs2 = query_get_value(SHOW STATUS LIKE 'Innodb_os_log_fsyncs', Value, 1)
+--let $syncs2 = query_get_value(SHOW STATUS LIKE 'Innodb_data_fsyncs', Value, 1)
eval SET @num_sync = $syncs2 - $syncs1;
--enable_query_log
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test
new file mode 100644
index 00000000000..9c79925b4bd
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_glle_ordered.test
@@ -0,0 +1,43 @@
+#
+# Purpose:
+# This test validates that GTIDs are ordered when mysqlbinlog outputs
+# Gtid_list events.
+#
+# Methodology:
+# Write multiple events to the binlog with different domain ids and server
+# ids, and ensure that the Gtid_list event GTIDs are ordered first by domain id
+# (ascending), and then sequence number (ascending).
+#
+# References:
+# MDEV-4989: Support for GTID in mysqlbinlog
+#
+--source include/have_log_bin.inc
+
+RESET MASTER;
+SET @@session.gtid_domain_id= 0;
+SET @@session.server_id= 1;
+CREATE TABLE t1 (a int);
+SET @@session.gtid_domain_id= 1;
+SET @@session.server_id= 2;
+CREATE TABLE t2 (a int);
+SET @@session.server_id= 1;
+INSERT INTO t2 VALUES (1);
+SET @@session.gtid_domain_id= 2;
+SET @@session.server_id= 3;
+CREATE TABLE t3 (a int);
+FLUSH LOGS;
+FLUSH LOGS;
+
+--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/tmp_binlog.out
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > SEARCH_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $SEARCH_FILE
+
+--let SEARCH_PATTERN= Gtid list \[0-1-1,\n# 1-2-1,\n# 1-1-2,\n# 2-3-1\]
+--source include/search_pattern_in_file.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_strict_mode.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_strict_mode.test
new file mode 100644
index 00000000000..166826408d9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_strict_mode.test
@@ -0,0 +1,105 @@
+#
+# Purpose:
+#
+# This test ensures that the mariadb-binlog CLI tool properly displays errors
+# and warnings for out of order GTIDs.
+#
+#
+# Methodology:
+#
+# We simulate invalid sequence numberings by manually changing gtid_seq_no to
+# differ from its expected linear sequence. Specifically, we test the following
+# cases:
+# Test Case 1) Sequential sequence numbers results in no warnings
+# Test Case 2) A skipped sequence number results in no warnings if all numbers
+# are monotonic (i.e. gaps in sequence number are allowed
+# provided they never decrease)
+# Test Case 3) A sequence number lower than the last processed value results
+# in a warning
+# Test Case 4) Skipping a GTID and later receiving it results in a warning
+# Test Case 5) Repeat sequence numbers result in a warning
+# Test Case 6) Warnings from different domains are all displayed
+# Test Case 7) A decreasing seq_no before a start-position is ignored
+# Test Case 8) A decreasing seq_no inside of a --start/--stop position window
+# is displayed
+# Test Case 9) Error if --stop-position is not greater than or equal to
+# --start-position
+# Test Case 10) Strict mode warnings should be independent of --offset option
+# specification
+# Test Case 11) Strict mode warnings should be independent of
+# --start-timestamp option specification
+# Test Case 12) Specifying multiple binary logs with a log-position start
+# should skip GTID state verification
+# Test Case 13) If multiple binary logs should be specified but a middle log
+# is missing, we should detect that and warn when using -vvv
+# Test Case 14) If a --stop-position GTID occurs before the first specified
+# binlog's GLLE, error
+#
+# Note that test cases are tested under three scenarios:
+# 1) --gtid-strict-mode should error and immediately quit with error on out of
+# order GTIDs
+# 2) --skip-gtid-strict-mode -vvv should not quit early or with error when
+# encountering out of order GTIDs; however should produce warnings after
+# binlog processing
+# 3) --skip-gtid-strict-mode should neither produce errors nor warnings when
+# encountering out of order GTIDs
+#
+# References:
+# MDEV-4989: Support for GTID in mysqlbinlog
+#
+
+--source include/have_log_bin.inc
+
+--echo ###############################
+--echo # Test Setup
+--echo ###############################
+
+## Save old state
+#
+let orig_gtid_domain_id = `select @@session.gtid_domain_id`;
+let orig_server_id = `select @@session.server_id`;
+RESET MASTER;
+
+--echo ####################################################
+--echo # Test Case Group 1
+--echo #
+--echo # Tests with --gtid-strict-mode should error and
+--echo # immediately quit with error on out of order GTIDs
+--echo ####################################################
+--let is_strict_mode= 1
+--let is_verbose= 0
+--let DEFAULT_ERROR_PREFIX=ERROR
+--source include/mysqlbinlog_gtid_strict_mode.inc
+
+--echo ####################################################
+--echo # Test Case Group 2
+--echo #
+--echo # Test cases with --skip-gtid-strict-mode -vvv
+--echo # should not quit early or with error when
+--echo # encountering out of order GTIDs; however should
+--echo # produce warnings after binlog processing
+--echo ####################################################
+--let is_strict_mode= 0
+--let is_verbose= 1
+--let DEFAULT_ERROR_PREFIX=WARNING
+--source include/mysqlbinlog_gtid_strict_mode.inc
+
+--echo ####################################################
+--echo # Test Case Group 3
+--echo #
+--echo # Run test cases with --skip-gtid-strict-mode should
+--echo # neither produce errors nor warnings when
+--echo # encountering out of order GTIDs
+--echo ####################################################
+--let is_strict_mode= 0
+--let is_verbose= 0
+--let DEFAULT_ERROR_PREFIX=(ERROR|WARNING)
+--source include/mysqlbinlog_gtid_strict_mode.inc
+
+--echo ##############################
+--echo # Cleanup
+--echo ##############################
+--eval SET @@global.gtid_domain_id= $orig_gtid_domain_id
+--eval SET @@global.server_id= $orig_server_id
+
+--echo End of the tests
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_window.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_window.test
new file mode 100644
index 00000000000..3efb8d025b9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_gtid_window.test
@@ -0,0 +1,151 @@
+#
+# Purpose:
+#
+# This test ensures that the mariadb-binlog CLI tool can filter log events
+# using GTID ranges. More specifically, this test ensures the following
+# capabilities:
+# 1) GTIDs can be used to filter results on local binlog files
+# 2) GTIDs can be used to filter results from remote servers
+# 3) For a given GTID range, its start-position is exclusive and its
+# stop-position is inclusive. This allows users to receive events strictly
+# after what they already have.
+# 4) After the events have been written, the session server id and domain id
+# are reset to their former values
+#
+#
+# Methodology:
+#
+# This test validates the expected capabilities using the following test cases
+# on both a local binlog file and remote server for all binlog formats.
+# Test Case 1) The end of the binlog file resets the server and domain id of
+# the session
+# Test Case 2) Single GTID range specified
+# Test Case 3) Single GTID range with different server_ids
+# Test Case 4) Multiple GTID ranges specified
+# Test Case 5) Multiple GTID ranges specified where the domain ids are
+# listed in different orders between start/stop position
+# Test Case 6) Only start position specified
+# Test Case 7) Only stop position specified
+# Test Case 8) Seq_no=0 in --start-position includes all events for a domain
+# Test Case 9) Seq_no=0 in --stop-position excludes all events for a domain
+# Test Case 10) Output stops for all domain ids when all --stop-position GTID
+# values have been hit.
+# Test Case 11) All GTID events from other domains are printed until
+# the --stop-position values are hit
+# Test Case 12) Scalar and GTID values can be used together for stop or start
+# position
+# Test Case 13) If the start position is delayed within the binlog, events
+# occurring before that position are ignored
+# Test Case 14) If start position is repeated, the last specification
+# overrides all previous ones
+# Test Case 15) If stop position is repeated, the last specification
+# overrides all previous ones
+# Test Case 16) Start position with --offset=<n> skips n events after the
+# first GTID is found
+# Test Case 17) Start position with --start-datetime=<T> where T occurs
+# after the specified GTID results in no events before T
+# Test Case 18) If --stop-position is specified, domains which are not present
+# in its list should be excluded from output
+# Test Case 19) If the start and stop GTIDs in any domain are equal, the
+# domain should not have any output
+# Test Case 20) If --start-position and --stop-position have different domain
+# ids, only events from GTIDs in the --stop-position list are
+# output
+# Test Case 21) Successive binary logs (e.g. logs with previous logs that
+# have been purged) will write events when the --start-position
+# matches their Gtid_list_log_event state
+# Test Case 22) Successive binary logs can be called with --stop-position and
+# without --start-position
+#
+# To validate for data consistency, each test case compares a checksum of
+# correct data against a variant created after replaying the binlog using
+# --(start|stop)-position. If the checksums are identical, the test passes.
+# If the checksums differ, data has been changed and the test fails.
+#
+# Additionally, this test validates the following error scenarios:
+# Error Case 1) A GTID --start-position that does not mention all domains
+# that make up the binary log state should error
+# Error Case 2) A GTID --start-position with any sequence numbers which
+# occur before the binary log state should result in error
+# Error Case 3) A GTID --start-position with any sequence numbers that are not
+# eventually processed results in error
+# Error Case 4) User provides invalid positions
+# Error Case 5) User provides GTID ranges with repeated domain ids
+#
+# References:
+# MDEV-4989: Support for GTID in mysqlbinlog
+#
+
+--source include/have_log_bin.inc
+
+--echo ###############################
+--echo # Test Setup
+--echo ###############################
+
+## Save old state
+#
+let orig_gtid_domain_id = `select @@session.gtid_domain_id`;
+let orig_server_id = `select @@session.server_id`;
+RESET MASTER;
+
+
+--echo ######################################
+--echo # Test Group 1
+--echo # Run test cases on local log file
+--echo ######################################
+--let is_remote= 0
+--source include/mysqlbinlog_gtid_window_test_cases.inc
+
+--echo ######################################
+--echo # Test Group 2
+--echo # Run test cases on remote host
+--echo ######################################
+--let is_remote= 1
+--source include/mysqlbinlog_gtid_window_test_cases.inc
+
+# Note that error cases 1-3 are in mysqlbinlog_gtid_window_test_cases.inc
+# because we validate for error consistency of GTID state between
+# mariadb-binlog working on local files and receiving errors from a server
+
+--let err_out_= $MYSQLTEST_VARDIR/tmp/err.out
+--let tmp_out_= $MYSQLTEST_VARDIR/tmp/std.out
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+--echo #
+--echo # Error Case 4:
+--echo # User provides invalid positions
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=z
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=z
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=1-
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-2
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=1-2
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=1-2-
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=1-2-
+
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=-1
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=-1
+
+--echo #
+--echo # Error Case 5:
+--echo # User provides GTID ranges with repeated domain ids
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1,0-1-8 --stop-position=0-1-4,0-1-12
+--error 1
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1,0-1-8 --stop-position=0-1-4,0-1-12
+
+
+--echo ##############################
+--echo # Cleanup
+--echo ##############################
+--eval SET @@global.gtid_domain_id= $orig_gtid_domain_id
+--eval SET @@global.server_id= $orig_server_id
+
+--echo # End of the tests
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_alter_verbose.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_alter_verbose.test
new file mode 100644
index 00000000000..338326d144f
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_alter_verbose.test
@@ -0,0 +1,58 @@
+#
+# Purpose:
+#
+# This test ensures that mysqlbinlog prints a comment when two-phase alter
+# is enabled which shows the original alter query issued.
+#
+#
+# References:
+# MENT-662: Finalize MDEV-11675 "Lag Free Alter On Slave"
+#
+
+# Just row format for faster testing
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+
+#---
+# Setup
+#---
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+
+RESET MASTER;
+create table myt (a int) engine=InnoDB;
+
+
+#---
+# Issue ALTER
+#---
+alter table myt add column (b int);
+
+
+#---
+# Check binlog output
+#---
+FLUSH LOGS;
+
+--disable_query_log
+--let $MYSQLD_DATADIR= `select @@datadir`
+--let $BINLOG_FILENAME= query_get_value(SHOW BINARY LOGS, Log_name, 1)
+
+--echo # Exec MYSQL_BINLOG --base64-output=decode-rows -v MYSQLD_DATADIR/BINLOG_FILENAME > MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v $MYSQLD_DATADIR/$BINLOG_FILENAME > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
+
+create table raw_binlog_rows (txt varchar(1000));
+--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
+--enable_query_log
+--echo Verbose statements from : $BINLOG_FILENAME
+# Output --verbose lines, with extra Windows CR's trimmed
+select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
+
+#---
+# Cleanup
+#---
+drop table raw_binlog_rows;
+drop table myt;
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase
diff --git a/mysql-test/suite/binlog/t/start_alter_mysqlbinlog_replay.test b/mysql-test/suite/binlog/t/start_alter_mysqlbinlog_replay.test
new file mode 100644
index 00000000000..d59456d72f6
--- /dev/null
+++ b/mysql-test/suite/binlog/t/start_alter_mysqlbinlog_replay.test
@@ -0,0 +1,61 @@
+#
+# MENT-662: Lag Free Alter On Slave
+#
+
+--echo #
+--echo # Test verifies replay of binary logs which contain
+--echo # SA/RA/CA works fine.
+--echo # Generate a binary log with alter events and use mysqlbinlog tool to
+--echo # generate a sql file for replay. Source it on an clean master and
+--echo # verify the correctness. Use the latest binlog and repeat the same
+--echo # process mentioned above and observe replay works fine.
+--echo #
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+
+create table t1 (f1 int primary key) engine=InnoDB;
+create table t2 (f1 int primary key, constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
+
+--error ER_CANT_CREATE_TABLE
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+
+drop table t2, t1;
+select @@gtid_binlog_state;
+FLUSH LOGS;
+
+let MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/slave_1.sql
+
+--echo # reset the binlog
+RESET MASTER;
+--echo # execute the binlog
+--exec $MYSQL --port=$MASTER_MYPORT --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/slave_1.sql"
+SELECT @@gtid_binlog_state;
+FLUSH LOGS;
+--echo # Replay 1: One more time to simulate S->S case
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/slave_2.sql
+
+RESET MASTER;
+--echo # execute the binlog
+--exec $MYSQL --port=$MASTER_MYPORT --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/slave_2.sql"
+SELECT @@gtid_binlog_state;
+FLUSH LOGS;
+--echo # Replay 2: One more time to simulate S->S case
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/slave_3.sql
+RESET MASTER;
+--echo # execute the binlog
+--exec $MYSQL --port=$MASTER_MYPORT --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/slave_3.sql"
+SELECT @@gtid_binlog_state;
+
+--echo # clean up
+remove_file $MYSQLTEST_VARDIR/tmp/slave_1.sql;
+remove_file $MYSQLTEST_VARDIR/tmp/slave_2.sql;
+remove_file $MYSQLTEST_VARDIR/tmp/slave_3.sql;
+RESET MASTER;
+
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase
diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result b/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
index 9edec669908..b878042174b 100644
--- a/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
+++ b/mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
@@ -21,7 +21,7 @@ Table Create Table
t2 CREATE TABLE "t2" (
"a" int(11) DEFAULT NULL,
"b" text DEFAULT NULL,
- "c" char(1) DEFAULT NULL
+ "c" varchar(1) DEFAULT NULL
)
DROP PROCEDURE p2;
DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor.result b/mysql-test/suite/compat/oracle/r/sp-cursor.result
index 2e0c43c8b87..aa9c5de8bc9 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor.result
@@ -454,12 +454,12 @@ CALL p1('1b');
msg
Fetched a record a=1
Warnings:
-Warning 1265 Data truncated for column 'p_a' at row 1
+Warning 1265 Data truncated for column 'p_a' at row 0
CALL p1('b1');
msg
Fetched a record a=0
Warnings:
-Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 1
+Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 0
DROP PROCEDURE p1;
#
# One parameter in SELECT list + subselect
@@ -977,3 +977,46 @@ $$
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+#
+# Start of 10.8 tests
+#
+#
+# MDEV-10654 IN, OUT, INOUT parameters in CREATE FUNCTION
+#
+DECLARE
+va INT;
+CURSOR cur (a IN INT) IS SELECT a FROM dual;
+BEGIN
+OPEN cur(1);
+FETCH cur INTO va;
+CLOSE cur;
+SELECT va;
+END;
+$$
+va
+1
+DECLARE
+va INT;
+CURSOR cur (a OUT INT) IS SELECT a FROM dual;
+BEGIN
+OPEN cur(1);
+FETCH cur INTO va;
+CLOSE cur;
+SELECT va;
+END;
+$$
+ERROR 42000: This version of MariaDB doesn't yet support 'OUT/INOUT cursor parameter'
+DECLARE
+va INT;
+CURSOR cur (a INOUT INT) IS SELECT a FROM dual;
+BEGIN
+OPEN cur(1);
+FETCH cur INTO va;
+CLOSE cur;
+SELECT va;
+END;
+$$
+ERROR 42000: This version of MariaDB doesn't yet support 'OUT/INOUT cursor parameter'
+#
+# End of 10.8 tests
+#
diff --git a/mysql-test/suite/compat/oracle/r/sp-inout.result b/mysql-test/suite/compat/oracle/r/sp-inout.result
new file mode 100644
index 00000000000..fa6f5076d59
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-inout.result
@@ -0,0 +1,2571 @@
+#
+# MDEV-10654 IN, OUT, INOUT parameters in CREATE FUNCTION
+#
+SET sql_mode=ORACLE;
+#
+# CREATE PACKAGE with procedure and function with IN, OUT, INOUT qualifiers
+# And SHOW CREATE PACKAGE
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(d, a, b, c);
+d := d + c + res;
+END;
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT
+AS
+BEGIN
+c := c + 6;
+d := 10;
+RETURN a - b;
+END;
+END;
+$$
+SHOW CREATE PACKAGE pkg2;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg2 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg2;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg2 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg2" AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(d, a, b, c);
+d := d + c + res;
+END;
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT
+AS
+BEGIN
+c := c + 6;
+d := 10;
+RETURN a - b;
+END;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+DROP PACKAGE pkg2;
+#
+# CREATE FUNCTION with IN, OUT, INOUT qualifiers
+# SHOW CREATE FUNCTION
+#
+CREATE OR REPLACE FUNCTION add_func(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+AS
+BEGIN
+c := 100;
+d := d + 1;
+RETURN a + b;
+END;
+$$
+SHOW CREATE FUNCTION add_func;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+add_func PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" FUNCTION "add_func"(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN int(11)
+AS
+BEGIN
+c := 100;
+d := d + 1;
+RETURN a + b;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+DROP FUNCTION add_func;
+#
+# CREATE PROCEDURE with IN, OUT, INOUT qualifiers
+# SHOW CREATE PROCEDURE
+#
+CREATE OR REPLACE PROCEDURE add_proc(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+BEGIN
+d := a + b + c + d;
+END;
+$$
+SHOW CREATE PROCEDURE add_proc;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+add_proc PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PROCEDURE "add_proc"(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+BEGIN
+d := a + b + c + d;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+DROP PROCEDURE add_proc;
+#
+# Call function from SELECT query
+# SELECT > FUNCTION(IN)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION add_func2 (a IN INT, b IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION add_func2(a IN INT, b IN INT) RETURN INT
+AS
+BEGIN
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+select pkg2.add_func2(@a, @b);
+pkg2.add_func2(@a, @b)
+5
+DROP PACKAGE pkg2;
+#
+# Call function from SELECT query
+# SELECT > FUNCTION(OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION add_func3 (a IN INT, b IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION add_func3(a IN INT, b IN INT, c OUT INT) RETURN INT
+AS
+BEGIN
+c := 100;
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+select pkg2.add_func3(@a, @b, @c);
+ERROR HY000: OUT or INOUT argument 3 for function pkg2.add_func3 is not allowed here
+DROP PACKAGE pkg2;
+#
+# Call function from SELECT query
+# SELECT > FUNCTION(INOUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION add_func4 (a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION add_func4(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+AS
+BEGIN
+c := 100;
+d := d + 1;
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+set @d = 9;
+select pkg2.add_func4(@a, @b, @c, @d);
+ERROR HY000: OUT or INOUT argument 3 for function pkg2.add_func4 is not allowed here
+DROP PACKAGE pkg2;
+#
+# Call from procedure
+# PROCEDURE(OUT) > FUNCTION(IN)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE add_proc2 (a IN INT, b IN INT, c OUT INT);
+FUNCTION add_func2 (a IN INT, b IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE add_proc2(a IN INT, b IN INT, c OUT INT)
+AS
+BEGIN
+c := add_func2(a, b);
+END;
+FUNCTION add_func2(a IN INT, b IN INT) RETURN INT
+AS
+BEGIN
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.add_proc2(@a, @b, @c);
+select @c;
+@c
+5
+DROP PACKAGE pkg2;
+#
+# Call from procedure
+# PROCEDURE(OUT) > FUNCTION(OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE add_proc3 (a IN INT, b IN INT, c OUT INT);
+FUNCTION add_func3 (a IN INT, b IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE add_proc3(a IN INT, b IN INT, c OUT INT)
+AS
+res INT;
+BEGIN
+res := add_func3(a, b, c);
+END;
+FUNCTION add_func3(a IN INT, b IN INT, c OUT INT) RETURN INT
+AS
+BEGIN
+c := 100;
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.add_proc3(@a, @b, @c);
+select @c;
+@c
+100
+DROP PACKAGE pkg2;
+#
+# Call from procedure
+# PROCEDURE(OUT) > FUNCTION(INOUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE add_proc4 (a IN INT, b IN INT, c OUT INT);
+FUNCTION add_func4 (a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE add_proc4(a IN INT, b IN INT, res OUT INT)
+AS
+c INT;
+d INT;
+BEGIN
+d := 30;
+res := add_func4(a, b, c, d);
+res := c + d;
+END;
+FUNCTION add_func4(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+AS
+BEGIN
+c := 100;
+d := d + 1;
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @res = 0;
+call pkg2.add_proc4(@a, @b, @res);
+select @res;
+@res
+131
+DROP PACKAGE pkg2;
+#
+# Call from procedure
+# PROCEDURE(OUT) > PROCEDURE(OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE test_proc1 (a IN INT, b IN INT, c OUT INT);
+PROCEDURE add_proc (a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE test_proc1(a IN INT, b IN INT, c OUT INT)
+AS
+BEGIN
+call pkg2.add_proc(a, b, c);
+END;
+PROCEDURE add_proc(a IN INT, b IN INT, c OUT INT)
+AS
+BEGIN
+c := a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.test_proc1(@a, @b, @c);
+select @c;
+@c
+5
+DROP PACKAGE pkg2;
+#
+# Argument's order change
+# PROCEDURE(a IN, b IN, c OUT) > FUNCTION(b IN, a IN, c OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT);
+FUNCTION func_sub(b IN INT, a IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(b, a, c);
+END;
+FUNCTION func_sub(b IN INT, a IN INT, c OUT INT) RETURN INT
+AS
+res INT;
+BEGIN
+c := a - b;
+res := a;
+RETURN res;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.proc_main(@a, @b, @c);
+select @c;
+@c
+-1
+DROP PACKAGE pkg2;
+#
+# Argument's order change
+# PROCEDURE(a IN, b IN, c OUT) > FUNCTION(c OUT, b IN, a IN)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT);
+FUNCTION func_sub(c OUT INT, b IN INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(c, b, a);
+END;
+FUNCTION func_sub(c OUT INT, b IN INT, a IN INT) RETURN INT
+AS
+res INT;
+BEGIN
+c := a - b;
+res := a;
+RETURN res;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.proc_main(@a, @b, @c);
+select @c;
+@c
+-1
+DROP PACKAGE pkg2;
+#
+# Argument's order change
+# PROCEDURE(a IN, b IN, c INOUT, d OUT) > FUNCTION(d OUT, a IN, b IN, c INOUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(d, a, b, c);
+d := d + c + res;
+END;
+FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT
+AS
+BEGIN
+c := c + 6;
+d := 10;
+RETURN a - b;
+END;
+END;
+$$
+set @a = 15;
+set @b = 5;
+set @c = 4;
+set @d= 0;
+call pkg2.proc_main(@a, @b, @c, @d);
+select @d;
+@d
+30
+DROP PACKAGE pkg2;
+#
+# Argument's order change
+# PROCEDURE(a IN INT, b IN INT, c INOUT INT, d OUT INT) > FUNCTION1(c INOUT INT, b IN INT) > FUNCTION2(d OUT INT, a IN INT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+FUNCTION func_sub1(c INOUT INT, b IN INT) RETURN INT;
+FUNCTION func_sub2(d OUT INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+res1 INT;
+res2 INT;
+BEGIN
+res1 := func_sub1(c, b);
+res2 := func_sub2(d, a);
+d := d + c;
+END;
+FUNCTION func_sub1(c INOUT INT, b IN INT) RETURN INT
+AS
+BEGIN
+c := c + b;
+RETURN 0;
+END;
+FUNCTION func_sub2(d OUT INT, a IN INT) RETURN INT
+AS
+BEGIN
+d := 5 + a;
+RETURN 0;
+END;
+END;
+$$
+set @a = 15;
+set @b = 6;
+set @c = 4;
+set @d= 0;
+call pkg2.proc_main(@a, @b, @c, @d);
+select @d;
+@d
+30
+DROP PACKAGE pkg2;
+#
+# Argument's order change
+# FUNCTION1(a IN, b IN) > FUNCTION2(b IN, c OUT, a IN)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT, b IN INT) RETURN INT;
+FUNCTION func_sub(b IN INT, c OUT INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT, b IN INT) RETURN INT
+AS
+c INT;
+res INT;
+BEGIN
+res := func_sub(b, c, a);
+RETURN res + c;
+END;
+FUNCTION func_sub(b IN INT, c OUT INT, a IN INT) RETURN INT
+AS
+BEGIN
+c := 100;
+RETURN a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+pkg2.func_main(@a, @b)
+105
+DROP PACKAGE pkg2;
+#
+# Call procedure inside function
+# FUNCTION1(a IN, b IN) > PROCEDURE(a IN, b IN, c OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT) RETURN INT;
+PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT) RETURN INT
+AS
+c INT;
+BEGIN
+call proc_sub(a, b, c);
+RETURN c;
+END;
+PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT)
+AS
+BEGIN
+c := a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+pkg2.func_main(@a, @b)
+5
+DROP PACKAGE pkg2;
+#
+# Call procedure inside function
+# FUNCTION1(a IN, b IN) > PROCEDURE(a IN, b INOUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT) RETURN INT;
+PROCEDURE proc_sub(a IN INT, b INOUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT) RETURN INT
+AS
+BEGIN
+call proc_sub(a, b);
+RETURN b;
+END;
+PROCEDURE proc_sub(a IN INT, b INOUT INT)
+AS
+BEGIN
+b := a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+pkg2.func_main(@a, @b)
+5
+DROP PACKAGE pkg2;
+#
+# Call procedure inside function
+# FUNCTION1(a IN, b IN, c OUT) > PROCEDURE(a IN, b IN, c OUT)
+#
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT, c OUT INT) RETURN INT;
+PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(b IN INT, a IN INT, c OUT INT) RETURN INT
+AS
+res INT;
+BEGIN
+call proc_sub(a, b, c);
+RETURN 0;
+END;
+PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT)
+AS
+BEGIN
+c := a + b;
+END;
+END;
+$$
+set @a = 2;
+set @b = 3;
+set @c = 0;
+select pkg2.func_main(@a, @b, @c);
+ERROR HY000: OUT or INOUT argument 3 for function pkg2.func_main is not allowed here
+DROP PACKAGE pkg2;
+#
+# Call function from UPDATE query
+# UPDATE <table> SET <column> = FUNCTION(a IN)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT
+AS
+BEGIN
+RETURN a * 10;
+END;
+END;
+$$
+set @a = 5;
+UPDATE Persons SET Age = pkg2.func(@a) WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Call function from UPDATE query
+# UPDATE <table> SET <column> = FUNCTION(a OUT)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+a := 5;
+RETURN 80;
+END;
+END;
+$$
+set @a = 0;
+UPDATE Persons SET Age = pkg2.func(@a) WHERE ID = 1;
+ERROR HY000: OUT or INOUT argument 1 for function pkg2.func is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Call function from INSERT query
+# INSERT INTO <table> SELECT <val1>, <val2>, FUNCTION(a IN)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT
+AS
+BEGIN
+RETURN a * 10;
+END;
+END;
+$$
+set @a = 4;
+INSERT INTO Persons SELECT 4, 'DDD', PKG2.func(@a);
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Call function from INSERT query
+# INSERT INTO <table> SELECT <val1>, <val2>, FUNCTION(a OUT)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+a := 45;
+RETURN 40;
+END;
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+set @a = 0;
+INSERT INTO Persons SELECT 5, 'EEE', PKG2.func(@a);
+ERROR HY000: OUT or INOUT argument 1 for function PKG2.func is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Call function from DELETE query
+# DELETE FROM <table> WHERE <column> = FUNCTION(a IN)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT
+AS
+BEGIN
+RETURN a;
+END;
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 4;
+DELETE FROM Persons WHERE ID = PKG2.func(@a);
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Call function from DELETE query
+# DELETE FROM <table> WHERE <column> = FUNCTION(a OUT)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+a := 40;
+RETURN 4;
+END;
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 0;
+DELETE FROM Persons WHERE ID = PKG2.func(@a);
+ERROR HY000: OUT or INOUT argument 1 for function PKG2.func is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# SELECT query inside function
+# FUNCTION(a IN) > SELECT … FROM <table>
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+c INT;
+BEGIN
+SELECT AGE INTO c FROM Persons WHERE ID = a;
+RETURN c;
+END;
+END;
+$$
+set @a = 3;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+30
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# SELECT query inside function
+# FUNCTION(a OUT) > SELECT … FROM <table>
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a OUT INT) RETURN INT
+AS
+BEGIN
+SELECT AGE INTO a FROM Persons WHERE ID = 3;
+RETURN 0;
+END;
+END;
+$$
+set @a = 0;
+select pkg2.func_main(@a);
+ERROR HY000: OUT or INOUT argument 1 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# SELECT query inside function
+# FUNCTION(a INOUT) > SELECT … FROM <table>
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a INOUT INT) RETURN INT
+AS
+BEGIN
+SELECT AGE INTO a FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+set @a = 1;
+select pkg2.func_main(@a);
+ERROR HY000: OUT or INOUT argument 1 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# SELECT query inside function
+# FUNCTION(a IN) > FUNCTION(a IN, b OUT) > SELECT … FROM <table>
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+b INT;
+res INT;
+BEGIN
+res := func_sub(a, b);
+RETURN b;
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+set @a = 2;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+20
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# UPDATE query inside function
+# FUNCTION(a IN) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+c INT;
+BEGIN
+UPDATE Persons SET AGE = 50 WHERE ID = a;
+SELECT AGE INTO c FROM Persons WHERE ID = a;
+RETURN c;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+set @a = 5;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+50
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 50
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# UPDATE query inside function
+# FUNCTION(a IN, b OUT) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+UPDATE Persons SET AGE = 60 WHERE ID = a;
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+set @a = 5;
+set @b = 0;
+select pkg2.func_main(@a, @b);
+ERROR HY000: OUT or INOUT argument 2 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# UPDATE query inside function
+# FUNCTION(a IN, b INOUT) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT
+AS
+BEGIN
+UPDATE Persons SET AGE = 60 WHERE ID = a;
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+set @a = 5;
+set @b = 0;
+select pkg2.func_main(@a, @b);
+ERROR HY000: OUT or INOUT argument 2 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# UPDATE query inside function
+# FUNCTION(a IN) > FUNCTION(a IN, b OUT) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 80);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+b INT;
+res INT;
+BEGIN
+res := func_sub(a, b);
+RETURN b;
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+UPDATE Persons SET AGE = 10 WHERE ID = a;
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 80
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+set @a = 1;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+10
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# INSERT query inside function
+# FUNCTION(a IN) > INSERT INTO <table> VALUES …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 50);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+b INT;
+BEGIN
+INSERT INTO Persons VALUE (a, 'FFF', 60);
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN b;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 50
+set @a = 6;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+60
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 50
+6 FFF 60
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# INSERT query inside function
+# FUNCTION(a IN, b OUT) > INSERT INTO <table> VALUES …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 50);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+INSERT INTO Persons VALUE (a, 'FFF', 60);
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 50
+set @a = 6;
+set @b = 0;
+select pkg2.func_main(@a, @b);
+ERROR HY000: OUT or INOUT argument 2 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# INSERT query inside function
+# FUNCTION(a IN, b INOUT) > INSERT INTO <table> VALUES …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT
+AS
+BEGIN
+INSERT INTO Persons VALUE (a, 'FFF', 60);
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+set @a = 6;
+set @b = 0;
+select pkg2.func_main(@a, @b);
+ERROR HY000: OUT or INOUT argument 2 for function pkg2.func_main is not allowed here
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# INSERT query inside function
+# FUNCTION(a IN) > FUNCTION(a IN, b OUT) > INSERT INTO <table> VALUES …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func_main(a IN INT) RETURN INT
+AS
+b INT;
+res INT;
+BEGIN
+res := func_sub(a, b);
+RETURN b;
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+INSERT INTO Persons VALUE (a, 'FFF', 60);
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+set @a = 6;
+select pkg2.func_main(@a);
+pkg2.func_main(@a)
+60
+select * from Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 EEE 40
+6 FFF 60
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(IN) > SELECT FROM <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+BEGIN
+b := func_sub(a);
+END;
+FUNCTION func_sub(a IN INT) RETURN INT
+AS
+b INT;
+BEGIN
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN b;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 2;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+@b
+20
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(OUT) > SELECT FROM <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(a, b);
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+SELECT AGE INTO b FROM Persons WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 1;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+@b
+50
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(INOUT) > SELECT FROM <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+c INT;
+res INT;
+BEGIN
+c := 5;
+res := func_sub(a, c);
+b := c;
+END;
+FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+AS
+res INT;
+BEGIN
+SELECT AGE INTO res FROM Persons WHERE ID = a;
+c := c * 100;
+RETURN res;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 2;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+@b
+500
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(IN) > INSESRT INTO <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+BEGIN
+b := func_sub(a);
+END;
+FUNCTION func_sub(a IN INT) RETURN INT
+AS
+BEGIN
+INSERT INTO Persons VALUE (a, 'FFF', 50);
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+set @a = 5;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(OUT) > INSESRT INTO <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(a, b);
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+INSERT INTO Persons VALUE (a, 'GGG', 60);
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+set @a = 6;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+6 GGG 60
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(INOUT) > INSESRT INTO <table> …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+c INT;
+res INT;
+BEGIN
+c := 5;
+res := func_sub(a, c);
+b := c;
+END;
+FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+AS
+res INT;
+BEGIN
+INSERT INTO Persons VALUE (a, 'HHH', 70);
+c := c * 100;
+RETURN res;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+6 GGG 60
+set @a = 7;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+6 GGG 60
+7 HHH 70
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(IN) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+BEGIN
+b := func_sub(a);
+END;
+FUNCTION func_sub(a IN INT) RETURN INT
+AS
+BEGIN
+UPDATE Persons SET AGE = 100 WHERE ID = a;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 50
+6 GGG 60
+7 HHH 70
+set @a = 5;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 100
+6 GGG 60
+7 HHH 70
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 100);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+res INT;
+BEGIN
+res := func_sub(a, b);
+END;
+FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+AS
+BEGIN
+UPDATE Persons SET AGE = 100 WHERE ID = a;
+b := 1;
+RETURN 0;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 100
+6 GGG 60
+7 HHH 70
+set @a = 6;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 100
+6 GGG 100
+7 HHH 70
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# PROCEDURE > FUNCTION > SQL query
+# PROCEDURE(OUT) > FUNCTION(INOUT) > UPDATE <table> SET …
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 100);
+INSERT INTO Persons VALUES (6, 'GGG', 100);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT);
+FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc_main(a IN INT, b OUT INT)
+AS
+c INT;
+res INT;
+BEGIN
+c := 5;
+res := func_sub(a, c);
+b := c;
+END;
+FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+AS
+res INT;
+BEGIN
+UPDATE Persons SET AGE = 100 WHERE ID = a;
+c := c * 100;
+RETURN res;
+END;
+END;
+$$
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 100
+6 GGG 100
+7 HHH 70
+set @a = 7;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+4 DDD 40
+5 FFF 100
+6 GGG 100
+7 HHH 100
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 20 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 20
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(IN) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a IN INT) RETURN INT
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+a INT;
+res INT;
+BEGIN
+a := 10;
+res := 0;
+res := pkg2.func(a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 30 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 30
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(OUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 40);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+a := 100;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+a INT;
+res INT;
+BEGIN
+a := 10;
+res := 0;
+res := pkg2.func(a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 40
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(INOUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+FUNCTION func(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+FUNCTION func(a INOUT INT) RETURN INT
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+a := 100;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+a INT;
+res INT;
+BEGIN
+a := 10;
+res := 0;
+res := pkg2.func(a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 60 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 60
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(IN) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a IN INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a IN INT)
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 30 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 30
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a OUT INT)
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(INOUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a INOUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a INOUT INT)
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+a := 100;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+set @a = 2;
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 50
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(IN) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a OUT INT);
+FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a OUT INT)
+AS
+res INT;
+BEGIN
+a := 100;
+res := func(a);
+END;
+FUNCTION func(a IN INT) RETURN INT
+AS
+BEGIN
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 60 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 60
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a OUT INT);
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a OUT INT)
+AS
+res INT;
+BEGIN
+a := 100;
+res := func(a);
+END;
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+a := 200;
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 80 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 80
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(INOUT) > UPDATE TABLE2
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a OUT INT);
+FUNCTION func(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a OUT INT)
+AS
+res INT;
+BEGIN
+a := 100;
+res := func(a);
+END;
+FUNCTION func(a INOUT INT) RETURN INT
+AS
+BEGIN
+a := 200;
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 90 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 90
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+1
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Trigger
+# TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE TABLE2 with OUT argument (to check if OUT is returning by reference)
+#
+CREATE TABLE Persons (
+ID int,
+Name varchar(255),
+Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+CREATE TABLE PersonsLog (
+UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+CREATE OR REPLACE PACKAGE pkg2
+AS
+PROCEDURE proc(a OUT INT);
+FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+PROCEDURE proc(a OUT INT)
+AS
+res INT;
+BEGIN
+res := func(a);
+UPDATE PersonsLog SET UpdateCount = a;
+END;
+FUNCTION func(a OUT INT) RETURN INT
+AS
+BEGIN
+a := 111;
+UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+RETURN 0;
+END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+call pkg2.proc(@a);
+END;
+$$
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 10
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+0
+UPDATE Persons SET Age = 80 WHERE ID = 1;
+SELECT * FROM Persons;
+ID Name Age
+1 AAA 80
+2 BBB 20
+3 CCC 30
+SELECT * FROM PersonsLog;
+UpdateCount
+111
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+#
+# Package BODY variables as OUT parameters
+#
+CREATE PACKAGE pkg1 AS
+FUNCTION f1(b IN OUT INT) RETURN INT;
+FUNCTION show_private_variables() RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+pa INT:= 0;
+pb INT:= 10;
+FUNCTION f1(b IN OUT INT) RETURN INT AS
+BEGIN
+b:= b + 100;
+RETURN 500+b-100;
+END;
+FUNCTION show_private_variables() RETURN TEXT AS
+BEGIN
+RETURN 'Private variables: pa=' || pa || ' pb=' || pb;
+END;
+BEGIN
+SET pa=f1(pb);
+END;
+$$
+SELECT pkg1.show_private_variables();
+pkg1.show_private_variables()
+Private variables: pa=510 pb=110
+DROP PACKAGE pkg1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-param.result b/mysql-test/suite/compat/oracle/r/sp-param.result
index 3b9be4585d4..bb415bd74a7 100644
--- a/mysql-test/suite/compat/oracle/r/sp-param.result
+++ b/mysql-test/suite/compat/oracle/r/sp-param.result
@@ -152,7 +152,7 @@ begin
call p1(w,'0123456789');
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare w varchar(20);
begin
w:='aaa';
@@ -165,7 +165,7 @@ w:='aaa';
call p1(w,'0123456789');
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare str varchar(6000);
pout varchar(6000);
begin
@@ -184,7 +184,7 @@ call p1(pout,str);
select length(pout);
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare str varchar(40000);
pout varchar(60000);
begin
@@ -203,7 +203,7 @@ call p1(pout,str);
select length(pout);
end;
/
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
declare str text(80000);
pout text(80000);
begin
@@ -240,7 +240,7 @@ CALL p2(11);
LENGTH(pinout)
10
Warnings:
-Warning 1265 Data truncated for column 'pinout' at row 1
+Warning 1265 Data truncated for column 'pinout' at row 0
DROP PROCEDURE p1;
DROP PROCEDURE p2;
SET sql_mode=ORACLE;
@@ -261,12 +261,12 @@ CALL p2(65535);
LENGTH(f1(str,padlen))
65532
Warnings:
-Warning 1265 Data truncated for column 'pin' at row 1
+Warning 1265 Data truncated for column 'pin' at row 0
CALL p2(65536);
LENGTH(f1(str,padlen))
65532
Warnings:
-Warning 1265 Data truncated for column 'pin' at row 1
+Warning 1265 Data truncated for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -290,9 +290,9 @@ CALL p2(21844);
length(pout)
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP PROCEDURE p1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -316,9 +316,9 @@ CALL p2(21844);
length(pout)
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP PROCEDURE p1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -339,13 +339,13 @@ CALL p2(65532);
LENGTH(f1(str,padlen))
65532
CALL p2(65533);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65534);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65535);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65536);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -366,9 +366,9 @@ CALL p2(21844);
LENGTH(f1(str,padlen))
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -389,9 +389,9 @@ CALL p2(21844);
LENGTH(f1(str,padlen))
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -412,12 +412,12 @@ CALL p2(65532);
LENGTH(f1(str,padlen))
65532
CALL p2(65533);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65534);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65535);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65536);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-row.result b/mysql-test/suite/compat/oracle/r/sp-row.result
index 3ed11d7f9de..0b23f303030 100644
--- a/mysql-test/suite/compat/oracle/r/sp-row.result
+++ b/mysql-test/suite/compat/oracle/r/sp-row.result
@@ -24,7 +24,7 @@ RETURN a;
END;
$$
SELECT f1(ROW(10,20));
-ERROR 21000: Operand should contain 1 column(s)
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `f1(ROW(10,20))`
DROP FUNCTION f1;
#
# ROW as an SP parameter
@@ -261,7 +261,7 @@ SELECT f1(a);
END;
$$
CALL p1();
-ERROR 21000: Operand should contain 1 column(s)
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `a`
DROP PROCEDURE p1;
DROP FUNCTION f1;
CREATE FUNCTION f1(a INT) RETURN INT
@@ -278,7 +278,7 @@ SELECT f1(a);
END;
$$
CALL p1();
-ERROR 21000: Operand should contain 1 column(s)
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `a`
DROP PROCEDURE p1;
DROP FUNCTION f1;
#
@@ -332,7 +332,7 @@ RETURN rec;
END;
$$
SELECT f1(10);
-ERROR 21000: Operand should contain 1 column(s)
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `f1(10)`
DROP FUNCTION f1;
#
# Using the entire ROW in SELECT..CREATE
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
index 2e7b21b2d75..2e212530ae5 100644
--- a/mysql-test/suite/compat/oracle/r/sp.result
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -1286,7 +1286,7 @@ CALL p1();
a b
127 200
Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 0
DROP PROCEDURE p1;
DROP TABLE t1;
#
@@ -1703,8 +1703,8 @@ t2 CREATE TABLE "t2" (
"t2" text DEFAULT NULL,
"t3" mediumtext DEFAULT NULL,
"t4" longtext DEFAULT NULL,
- "enum1" char(1) DEFAULT NULL,
- "set1" char(5) DEFAULT NULL,
+ "enum1" varchar(1) DEFAULT NULL,
+ "set1" varchar(5) DEFAULT NULL,
"blob1" tinyblob DEFAULT NULL,
"blob2" longblob DEFAULT NULL,
"blob3" mediumblob DEFAULT NULL,
@@ -1865,8 +1865,8 @@ t2 CREATE TABLE "t2" (
"t2" text DEFAULT NULL,
"t3" mediumtext DEFAULT NULL,
"t4" longtext DEFAULT NULL,
- "enum1" char(1) DEFAULT NULL,
- "set1" char(5) DEFAULT NULL,
+ "enum1" varchar(1) DEFAULT NULL,
+ "set1" varchar(5) DEFAULT NULL,
"blob1" tinyblob DEFAULT NULL,
"blob2" longblob DEFAULT NULL,
"blob3" mediumblob DEFAULT NULL,
@@ -2370,7 +2370,7 @@ t1 CREATE TABLE "t1" (
"a_flt0" float DEFAULT NULL,
"a_dbl0" double DEFAULT NULL,
"a_bit3" bit(3) DEFAULT NULL,
- "a_enum0" char(1) DEFAULT NULL,
+ "a_enum0" varchar(1) DEFAULT NULL,
"a_varchar10" varchar(10) DEFAULT NULL,
"a_text1" text DEFAULT NULL,
"a_tinytext1" tinytext DEFAULT NULL,
@@ -2388,7 +2388,7 @@ t1 CREATE TABLE "t1" (
"aa_flt0" float DEFAULT NULL,
"aa_dbl0" double DEFAULT NULL,
"aa_bit3" bit(3) DEFAULT NULL,
- "aa_enum0" char(1) DEFAULT NULL,
+ "aa_enum0" varchar(1) DEFAULT NULL,
"aa_varchar10" varchar(10) DEFAULT NULL,
"aa_text1" text DEFAULT NULL,
"aa_tinytext1" tinytext DEFAULT NULL,
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor.test b/mysql-test/suite/compat/oracle/t/sp-cursor.test
index 03b8b016ee0..d7e2a5dee68 100644
--- a/mysql-test/suite/compat/oracle/t/sp-cursor.test
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor.test
@@ -987,3 +987,58 @@ DELIMITER ;$$
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+
+
+--echo #
+--echo # Start of 10.8 tests
+--echo #
+
+--echo #
+--echo # MDEV-10654 IN, OUT, INOUT parameters in CREATE FUNCTION
+--echo #
+
+DELIMITER $$;
+DECLARE
+ va INT;
+ CURSOR cur (a IN INT) IS SELECT a FROM dual;
+BEGIN
+ OPEN cur(1);
+ FETCH cur INTO va;
+ CLOSE cur;
+ SELECT va;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_NOT_SUPPORTED_YET
+DECLARE
+ va INT;
+ CURSOR cur (a OUT INT) IS SELECT a FROM dual;
+BEGIN
+ OPEN cur(1);
+ FETCH cur INTO va;
+ CLOSE cur;
+ SELECT va;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_NOT_SUPPORTED_YET
+DECLARE
+ va INT;
+ CURSOR cur (a INOUT INT) IS SELECT a FROM dual;
+BEGIN
+ OPEN cur(1);
+ FETCH cur INTO va;
+ CLOSE cur;
+ SELECT va;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # End of 10.8 tests
+--echo #
diff --git a/mysql-test/suite/compat/oracle/t/sp-inout.test b/mysql-test/suite/compat/oracle/t/sp-inout.test
new file mode 100644
index 00000000000..9f9d3bdb26a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-inout.test
@@ -0,0 +1,2497 @@
+--echo #
+--echo # MDEV-10654 IN, OUT, INOUT parameters in CREATE FUNCTION
+--echo #
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # CREATE PACKAGE with procedure and function with IN, OUT, INOUT qualifiers
+--echo # And SHOW CREATE PACKAGE
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+ FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(d, a, b, c);
+ d := d + c + res;
+ END;
+ FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT
+ AS
+ BEGIN
+ c := c + 6;
+ d := 10;
+ RETURN a - b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SHOW CREATE PACKAGE pkg2;
+SHOW CREATE PACKAGE BODY pkg2;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # CREATE FUNCTION with IN, OUT, INOUT qualifiers
+--echo # SHOW CREATE FUNCTION
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE FUNCTION add_func(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+AS
+ BEGIN
+ c := 100;
+ d := d + 1;
+ RETURN a + b;
+ END;
+$$
+DELIMITER ;$$
+
+SHOW CREATE FUNCTION add_func;
+DROP FUNCTION add_func;
+
+--echo #
+--echo # CREATE PROCEDURE with IN, OUT, INOUT qualifiers
+--echo # SHOW CREATE PROCEDURE
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PROCEDURE add_proc(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+AS
+ BEGIN
+ d := a + b + c + d;
+ END;
+$$
+DELIMITER ;$$
+
+SHOW CREATE PROCEDURE add_proc;
+DROP PROCEDURE add_proc;
+
+--echo #
+--echo # Call function from SELECT query
+--echo # SELECT > FUNCTION(IN)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION add_func2 (a IN INT, b IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION add_func2(a IN INT, b IN INT) RETURN INT
+ AS
+ BEGIN
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+select pkg2.add_func2(@a, @b);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from SELECT query
+--echo # SELECT > FUNCTION(OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION add_func3 (a IN INT, b IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION add_func3(a IN INT, b IN INT, c OUT INT) RETURN INT
+ AS
+ BEGIN
+ c := 100;
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.add_func3(@a, @b, @c);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from SELECT query
+--echo # SELECT > FUNCTION(INOUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION add_func4 (a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION add_func4(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+ AS
+ BEGIN
+ c := 100;
+ d := d + 1;
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+set @d = 9;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.add_func4(@a, @b, @c, @d);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call from procedure
+--echo # PROCEDURE(OUT) > FUNCTION(IN)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE add_proc2 (a IN INT, b IN INT, c OUT INT);
+ FUNCTION add_func2 (a IN INT, b IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE add_proc2(a IN INT, b IN INT, c OUT INT)
+ AS
+ BEGIN
+ c := add_func2(a, b);
+ END;
+
+ FUNCTION add_func2(a IN INT, b IN INT) RETURN INT
+ AS
+ BEGIN
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.add_proc2(@a, @b, @c);
+select @c;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call from procedure
+--echo # PROCEDURE(OUT) > FUNCTION(OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE add_proc3 (a IN INT, b IN INT, c OUT INT);
+ FUNCTION add_func3 (a IN INT, b IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE add_proc3(a IN INT, b IN INT, c OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := add_func3(a, b, c);
+ END;
+ FUNCTION add_func3(a IN INT, b IN INT, c OUT INT) RETURN INT
+ AS
+ BEGIN
+ c := 100;
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.add_proc3(@a, @b, @c);
+select @c;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call from procedure
+--echo # PROCEDURE(OUT) > FUNCTION(INOUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE add_proc4 (a IN INT, b IN INT, c OUT INT);
+ FUNCTION add_func4 (a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE add_proc4(a IN INT, b IN INT, res OUT INT)
+ AS
+ c INT;
+ d INT;
+ BEGIN
+ d := 30;
+ res := add_func4(a, b, c, d);
+ res := c + d;
+ END;
+ FUNCTION add_func4(a IN INT, b IN INT, c OUT INT, d INOUT INT) RETURN INT
+ AS
+ BEGIN
+ c := 100;
+ d := d + 1;
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @res = 0;
+call pkg2.add_proc4(@a, @b, @res);
+select @res;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call from procedure
+--echo # PROCEDURE(OUT) > PROCEDURE(OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE test_proc1 (a IN INT, b IN INT, c OUT INT);
+ PROCEDURE add_proc (a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE test_proc1(a IN INT, b IN INT, c OUT INT)
+ AS
+ BEGIN
+ call pkg2.add_proc(a, b, c);
+ END;
+ PROCEDURE add_proc(a IN INT, b IN INT, c OUT INT)
+ AS
+ BEGIN
+ c := a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.test_proc1(@a, @b, @c);
+select @c;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Argument's order change
+--echo # PROCEDURE(a IN, b IN, c OUT) > FUNCTION(b IN, a IN, c OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT);
+ FUNCTION func_sub(b IN INT, a IN INT, c OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(b, a, c);
+ END;
+ FUNCTION func_sub(b IN INT, a IN INT, c OUT INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ c := a - b;
+ res := a;
+ RETURN res;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.proc_main(@a, @b, @c);
+select @c;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Argument's order change
+--echo # PROCEDURE(a IN, b IN, c OUT) > FUNCTION(c OUT, b IN, a IN)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT);
+ FUNCTION func_sub(c OUT INT, b IN INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(c, b, a);
+ END;
+ FUNCTION func_sub(c OUT INT, b IN INT, a IN INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ c := a - b;
+ res := a;
+ RETURN res;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+call pkg2.proc_main(@a, @b, @c);
+select @c;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Argument's order change
+--echo # PROCEDURE(a IN, b IN, c INOUT, d OUT) > FUNCTION(d OUT, a IN, b IN, c INOUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+ FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(d, a, b, c);
+ d := d + c + res;
+ END;
+ FUNCTION func_sub(d OUT INT, a IN INT, b IN INT, c INOUT INT) RETURN INT
+ AS
+ BEGIN
+ c := c + 6;
+ d := 10;
+ RETURN a - b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 15;
+set @b = 5;
+set @c = 4;
+set @d= 0;
+call pkg2.proc_main(@a, @b, @c, @d);
+select @d;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Argument's order change
+--echo # PROCEDURE(a IN INT, b IN INT, c INOUT INT, d OUT INT) > FUNCTION1(c INOUT INT, b IN INT) > FUNCTION2(d OUT INT, a IN INT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT);
+ FUNCTION func_sub1(c INOUT INT, b IN INT) RETURN INT;
+ FUNCTION func_sub2(d OUT INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b IN INT, c INOUT INT, d OUT INT)
+ AS
+ res1 INT;
+ res2 INT;
+ BEGIN
+ res1 := func_sub1(c, b);
+ res2 := func_sub2(d, a);
+ d := d + c;
+ END;
+ FUNCTION func_sub1(c INOUT INT, b IN INT) RETURN INT
+ AS
+ BEGIN
+ c := c + b;
+ RETURN 0;
+ END;
+ FUNCTION func_sub2(d OUT INT, a IN INT) RETURN INT
+ AS
+ BEGIN
+ d := 5 + a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 15;
+set @b = 6;
+set @c = 4;
+set @d= 0;
+call pkg2.proc_main(@a, @b, @c, @d);
+select @d;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Argument's order change
+--echo # FUNCTION1(a IN, b IN) > FUNCTION2(b IN, c OUT, a IN)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT, b IN INT) RETURN INT;
+ FUNCTION func_sub(b IN INT, c OUT INT, a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT, b IN INT) RETURN INT
+ AS
+ c INT;
+ res INT;
+ BEGIN
+ res := func_sub(b, c, a);
+ RETURN res + c;
+ END;
+ FUNCTION func_sub(b IN INT, c OUT INT, a IN INT) RETURN INT
+ AS
+ BEGIN
+ c := 100;
+ RETURN a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call procedure inside function
+--echo # FUNCTION1(a IN, b IN) > PROCEDURE(a IN, b IN, c OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT) RETURN INT;
+ PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT) RETURN INT
+ AS
+ c INT;
+ BEGIN
+ call proc_sub(a, b, c);
+ RETURN c;
+ END;
+ PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT)
+ AS
+ BEGIN
+ c := a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call procedure inside function
+--echo # FUNCTION1(a IN, b IN) > PROCEDURE(a IN, b INOUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT) RETURN INT;
+ PROCEDURE proc_sub(a IN INT, b INOUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT) RETURN INT
+ AS
+ BEGIN
+ call proc_sub(a, b);
+ RETURN b;
+ END;
+ PROCEDURE proc_sub(a IN INT, b INOUT INT)
+ AS
+ BEGIN
+ b := a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+select pkg2.func_main(@a, @b);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call procedure inside function
+--echo # FUNCTION1(a IN, b IN, c OUT) > PROCEDURE(a IN, b IN, c OUT)
+--echo #
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT, c OUT INT) RETURN INT;
+ PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(b IN INT, a IN INT, c OUT INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ call proc_sub(a, b, c);
+ RETURN 0;
+ END;
+ PROCEDURE proc_sub(a IN INT, b IN INT, c OUT INT)
+ AS
+ BEGIN
+ c := a + b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+set @b = 3;
+set @c = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a, @b, @c);
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from UPDATE query
+--echo # UPDATE <table> SET <column> = FUNCTION(a IN)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT
+ AS
+ BEGIN
+ RETURN a * 10;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 5;
+UPDATE Persons SET Age = pkg2.func(@a) WHERE ID = 1;
+SELECT * FROM Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from UPDATE query
+--echo # UPDATE <table> SET <column> = FUNCTION(a OUT)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 5;
+ RETURN 80;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+UPDATE Persons SET Age = pkg2.func(@a) WHERE ID = 1;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from INSERT query
+--echo # INSERT INTO <table> SELECT <val1>, <val2>, FUNCTION(a IN)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT
+ AS
+ BEGIN
+ RETURN a * 10;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 4;
+INSERT INTO Persons SELECT 4, 'DDD', PKG2.func(@a);
+SELECT * FROM Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from INSERT query
+--echo # INSERT INTO <table> SELECT <val1>, <val2>, FUNCTION(a OUT)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 45;
+ RETURN 40;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+set @a = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+INSERT INTO Persons SELECT 5, 'EEE', PKG2.func(@a);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from DELETE query
+--echo # DELETE FROM <table> WHERE <column> = FUNCTION(a IN)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT
+ AS
+ BEGIN
+ RETURN a;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+set @a = 4;
+DELETE FROM Persons WHERE ID = PKG2.func(@a);
+SELECT * FROM Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Call function from DELETE query
+--echo # DELETE FROM <table> WHERE <column> = FUNCTION(a OUT)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 40;
+ RETURN 4;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+set @a = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+DELETE FROM Persons WHERE ID = PKG2.func(@a);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # SELECT query inside function
+--echo # FUNCTION(a IN) > SELECT … FROM <table>
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ c INT;
+ BEGIN
+ SELECT AGE INTO c FROM Persons WHERE ID = a;
+ RETURN c;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 3;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # SELECT query inside function
+--echo # FUNCTION(a OUT) > SELECT … FROM <table>
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ SELECT AGE INTO a FROM Persons WHERE ID = 3;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # SELECT query inside function
+--echo # FUNCTION(a INOUT) > SELECT … FROM <table>
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a INOUT INT) RETURN INT
+ AS
+ BEGIN
+ SELECT AGE INTO a FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 1;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # SELECT query inside function
+--echo # FUNCTION(a IN) > FUNCTION(a IN, b OUT) > SELECT … FROM <table>
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ b INT;
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ RETURN b;
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 2;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # UPDATE query inside function
+--echo # FUNCTION(a IN) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ c INT;
+ BEGIN
+ UPDATE Persons SET AGE = 50 WHERE ID = a;
+
+ SELECT AGE INTO c FROM Persons WHERE ID = a;
+ RETURN c;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 5;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # UPDATE query inside function
+--echo # FUNCTION(a IN, b OUT) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE Persons SET AGE = 60 WHERE ID = a;
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 5;
+set @b = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a, @b);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # UPDATE query inside function
+--echo # FUNCTION(a IN, b INOUT) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE Persons SET AGE = 60 WHERE ID = a;
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+set @a = 5;
+set @b = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a, @b);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # UPDATE query inside function
+--echo # FUNCTION(a IN) > FUNCTION(a IN, b OUT) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 80);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ b INT;
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ RETURN b;
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE Persons SET AGE = 10 WHERE ID = a;
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 1;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # INSERT query inside function
+--echo # FUNCTION(a IN) > INSERT INTO <table> VALUES …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 50);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ b INT;
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'FFF', 60);
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # INSERT query inside function
+--echo # FUNCTION(a IN, b OUT) > INSERT INTO <table> VALUES …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 50);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'FFF', 60);
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+set @b = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a, @b);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # INSERT query inside function
+--echo # FUNCTION(a IN, b INOUT) > INSERT INTO <table> VALUES …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT, b INOUT INT) RETURN INT
+ AS
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'FFF', 60);
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+set @b = 0;
+--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
+select pkg2.func_main(@a, @b);
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # INSERT query inside function
+--echo # FUNCTION(a IN) > FUNCTION(a IN, b OUT) > INSERT INTO <table> VALUES …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'EEE', 40);
+
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func_main(a IN INT) RETURN INT
+ AS
+ b INT;
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ RETURN b;
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'FFF', 60);
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+select pkg2.func_main(@a);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(IN) > SELECT FROM <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ BEGIN
+ b := func_sub(a);
+ END;
+ FUNCTION func_sub(a IN INT) RETURN INT
+ AS
+ b INT;
+ BEGIN
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN b;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 2;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(OUT) > SELECT FROM <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ SELECT AGE INTO b FROM Persons WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 1;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(INOUT) > SELECT FROM <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ c INT;
+ res INT;
+ BEGIN
+ c := 5;
+ res := func_sub(a, c);
+ b := c;
+ END;
+ FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ SELECT AGE INTO res FROM Persons WHERE ID = a;
+ c := c * 100;
+ RETURN res;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 2;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select @b;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(IN) > INSESRT INTO <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ BEGIN
+ b := func_sub(a);
+ END;
+ FUNCTION func_sub(a IN INT) RETURN INT
+ AS
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'FFF', 50);
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 5;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(OUT) > INSESRT INTO <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'GGG', 60);
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(INOUT) > INSESRT INTO <table> …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ c INT;
+ res INT;
+ BEGIN
+ c := 5;
+ res := func_sub(a, c);
+ b := c;
+ END;
+ FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ INSERT INTO Persons VALUE (a, 'HHH', 70);
+ c := c * 100;
+ RETURN res;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 7;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(IN) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 50);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ BEGIN
+ b := func_sub(a);
+ END;
+ FUNCTION func_sub(a IN INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE Persons SET AGE = 100 WHERE ID = a;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 5;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 100);
+INSERT INTO Persons VALUES (6, 'GGG', 60);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func_sub(a, b);
+ END;
+ FUNCTION func_sub(a IN INT, b OUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE Persons SET AGE = 100 WHERE ID = a;
+ b := 1;
+ RETURN 0;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 6;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # PROCEDURE > FUNCTION > SQL query
+--echo # PROCEDURE(OUT) > FUNCTION(INOUT) > UPDATE <table> SET …
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+INSERT INTO Persons VALUES (4, 'DDD', 40);
+INSERT INTO Persons VALUES (5, 'FFF', 100);
+INSERT INTO Persons VALUES (6, 'GGG', 100);
+INSERT INTO Persons VALUES (7, 'HHH', 70);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT);
+ FUNCTION func_sub(a IN INT, b INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc_main(a IN INT, b OUT INT)
+ AS
+ c INT;
+ res INT;
+ BEGIN
+ c := 5;
+ res := func_sub(a, c);
+ b := c;
+ END;
+ FUNCTION func_sub(a IN INT, c INOUT INT) RETURN INT
+ AS
+ res INT;
+ BEGIN
+ UPDATE Persons SET AGE = 100 WHERE ID = a;
+ c := c * 100;
+ RETURN res;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+select * from Persons;
+set @a = 7;
+set @b = 0;
+call pkg2.proc_main(@a, @b);
+select * from Persons;
+DROP TABLE Persons;
+DROP PACKAGE pkg2;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 20 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(IN) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a IN INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+ a INT;
+ res INT;
+BEGIN
+ a := 10;
+ res := 0;
+ res := pkg2.func(a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 30 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(OUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 40);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ a := 100;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+ a INT;
+ res INT;
+BEGIN
+ a := 10;
+ res := 0;
+ res := pkg2.func(a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > FUNCTION(INOUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 50);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ FUNCTION func(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ FUNCTION func(a INOUT INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ a := 100;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+DECLARE
+ a INT;
+ res INT;
+BEGIN
+ a := 10;
+ res := 0;
+ res := pkg2.func(a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 60 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(IN) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a IN INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a IN INT)
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 30 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a OUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a OUT INT)
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(INOUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a INOUT INT);
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a INOUT INT)
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ a := 100;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ set @a = 2;
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 50 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(IN) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a OUT INT);
+ FUNCTION func(a IN INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a OUT INT)
+ AS
+ res INT;
+ BEGIN
+ a := 100;
+ res := func(a);
+ END;
+ FUNCTION func(a IN INT) RETURN INT
+ AS
+ BEGIN
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 60 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a OUT INT);
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a OUT INT)
+ AS
+ res INT;
+ BEGIN
+ a := 100;
+ res := func(a);
+ END;
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 200;
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 80 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(INOUT) > UPDATE TABLE2
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a OUT INT);
+ FUNCTION func(a INOUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a OUT INT)
+ AS
+ res INT;
+ BEGIN
+ a := 100;
+ res := func(a);
+ END;
+ FUNCTION func(a INOUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 200;
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 90 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+--echo #
+--echo # Trigger
+--echo # TRIGGER AFTER UPDATE ON TABLE1 > PROCEDURE(OUT) > FUNCTION(OUT) > UPDATE TABLE2 with OUT argument (to check if OUT is returning by reference)
+--echo #
+
+CREATE TABLE Persons (
+ ID int,
+ Name varchar(255),
+ Age int
+);
+INSERT INTO Persons VALUES (1, 'AAA', 10);
+INSERT INTO Persons VALUES (2, 'BBB', 20);
+INSERT INTO Persons VALUES (3, 'CCC', 30);
+
+CREATE TABLE PersonsLog (
+ UpdateCount int
+);
+INSERT INTO PersonsLog VALUES (0);
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg2
+AS
+ PROCEDURE proc(a OUT INT);
+ FUNCTION func(a OUT INT) RETURN INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg2
+AS
+ PROCEDURE proc(a OUT INT)
+ AS
+ res INT;
+ BEGIN
+ res := func(a);
+ UPDATE PersonsLog SET UpdateCount = a;
+ END;
+ FUNCTION func(a OUT INT) RETURN INT
+ AS
+ BEGIN
+ a := 111;
+ UPDATE PersonsLog SET UpdateCount = UpdateCount+1;
+ RETURN 0;
+ END;
+END;
+$$
+CREATE OR REPLACE TRIGGER my_trigger
+AFTER UPDATE ON Persons
+FOR EACH ROW
+BEGIN
+ call pkg2.proc(@a);
+END;
+$$
+DELIMITER ;$$
+
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+UPDATE Persons SET Age = 80 WHERE ID = 1;
+SELECT * FROM Persons;
+SELECT * FROM PersonsLog;
+DROP TRIGGER my_trigger;
+DROP PACKAGE pkg2;
+DROP TABLE Persons;
+DROP TABLE PersonsLog;
+
+
+--echo #
+--echo # Package BODY variables as OUT parameters
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE pkg1 AS
+ FUNCTION f1(b IN OUT INT) RETURN INT;
+ FUNCTION show_private_variables() RETURN TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1 AS
+ pa INT:= 0;
+ pb INT:= 10;
+ FUNCTION f1(b IN OUT INT) RETURN INT AS
+ BEGIN
+ b:= b + 100;
+ RETURN 500+b-100;
+ END;
+
+ FUNCTION show_private_variables() RETURN TEXT AS
+ BEGIN
+ RETURN 'Private variables: pa=' || pa || ' pb=' || pb;
+ END;
+BEGIN
+ SET pa=f1(pb);
+END;
+$$
+DELIMITER ;$$
+SELECT pkg1.show_private_variables();
+DROP PACKAGE pkg1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-row.test b/mysql-test/suite/compat/oracle/t/sp-row.test
index ebd0a2a2137..c7658c76838 100644
--- a/mysql-test/suite/compat/oracle/t/sp-row.test
+++ b/mysql-test/suite/compat/oracle/t/sp-row.test
@@ -35,7 +35,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_OPERAND_COLUMNS
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT f1(ROW(10,20));
DROP FUNCTION f1;
@@ -334,7 +334,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_OPERAND_COLUMNS
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1();
DROP PROCEDURE p1;
DROP FUNCTION f1;
@@ -355,7 +355,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_OPERAND_COLUMNS
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1();
DROP PROCEDURE p1;
DROP FUNCTION f1;
@@ -427,7 +427,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_OPERAND_COLUMNS
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT f1(10);
DROP FUNCTION f1;
diff --git a/mysql-test/suite/encryption/r/bulk_insert.result b/mysql-test/suite/encryption/r/bulk_insert.result
new file mode 100644
index 00000000000..840cb0cd38b
--- /dev/null
+++ b/mysql-test/suite/encryption/r/bulk_insert.result
@@ -0,0 +1,7 @@
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1 (
+`id` int(10) unsigned NOT NULL,
+UNIQUE KEY `id` (`id`)
+) ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq FROM seq_1_to_65536;
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/corrupted_during_recovery.result b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
index 356dce64f8d..2b29bf260e1 100644
--- a/mysql-test/suite/encryption/r/corrupted_during_recovery.result
+++ b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(2);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
a
2
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index 1ca9d784d57..e2034f14e31 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -1,10 +1,10 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` has an unreadable root page");
+call mtr.add_suppression("Table .*t[12].* is corrupted");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# Start server with keys2.txt
@@ -46,29 +46,29 @@ INSERT INTO t2 VALUES ('foobar',1,2);
SELECT * FROM t2;
ERROR 42S02: Table 'test.t2' doesn't exist in engine
SELECT * FROM t2 where id = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
SELECT * FROM t2 where b = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
INSERT INTO t2 VALUES ('tmp',3,3);
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DELETE FROM t2 where b = 3;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DELETE FROM t2 where id = 3;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
UPDATE t2 set b = b +1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
-test.t2 optimize Error Table 'test.t2' doesn't exist in engine
-test.t2 optimize status Operation failed
+test.t2 optimize Error Table test/t2 is corrupted. Please drop the table and recreate.
+test.t2 optimize error Corrupt
ALTER TABLE t2 ADD COLUMN d INT;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
-test.t2 analyze Error Table 'test.t2' doesn't exist in engine
-test.t2 analyze status Operation failed
+test.t2 analyze Error Table test/t2 is corrupted. Please drop the table and recreate.
+test.t2 analyze error Corrupt
TRUNCATE TABLE t2;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DROP TABLE t2;
# Start server with keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index b4552651ae6..3cda2bd537b 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -1,9 +1,9 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
@@ -19,20 +19,20 @@ SHOW WARNINGS;
Level Code Message
Error 1932 Table 'test.t1' doesn't exist in engine
ALTER TABLE t1 ENGINE=InnoDB;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SHOW WARNINGS;
Level Code Message
-Error 1932 Table 'test.t1' doesn't exist in engine
+Error 1877 Table test/t1 is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Error Table 'test.t1' doesn't exist in engine
-test.t1 optimize status Operation failed
+test.t1 optimize Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 optimize error Corrupt
SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Table 'test.t1' doesn't exist in engine
-test.t1 check status Operation failed
+test.t1 check Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
@@ -64,5 +64,5 @@ t1 CREATE TABLE `t1` (
RENAME TABLE t1 TO t1new;
ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
ALTER TABLE t1 RENAME TO t1new;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index 5a3e275dda9..e808d50b544 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -1,8 +1,8 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
@@ -18,8 +18,8 @@ SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Table 'test.t1' doesn't exist in engine
-test.t1 check status Operation failed
+test.t1 check Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
index 6bacbfe78b2..d5c1e079e96 100644
--- a/mysql-test/suite/encryption/r/innodb-missing-key.result
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -1,8 +1,8 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` has an unreadable root page");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
@@ -40,9 +40,9 @@ COUNT(1)
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
SELECT COUNT(1) FROM t1 where b = 'ab';
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT COUNT(1) FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
index ba8f5b2fe85..859a73db056 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
@@ -8,6 +8,8 @@ call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) co
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
+call mtr.add_suppression("InnoDB: Missing FILE_CHECKPOINT");
+call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
index 8d1eb447b03..3c3e4831d8a 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result
@@ -12,16 +12,15 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
-FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log block
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
+FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
# empty redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
@@ -29,53 +28,55 @@ COUNT(*)
1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Corrupted multi-file redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 2 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
-# Empty multi-file redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
+# Empty multi-file redo log (wrong offset) from before MariaDB 10.2.2
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
-1
-FOUND 2 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+0
+FOUND 3 /Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint\./ in mysqld.1.err
# Multi-file redo log with size mismatch from after MariaDB 10.2.2
# Corrupted multi-file redo log from after MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!/ in mysqld.1.err
-FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+FOUND 3 /Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint\./ in mysqld.1.err
+FOUND 1 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 2 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
+FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 1048576 bytes!/ in mysqld.1.err
+FOUND 2 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
# Empty multi-file redo log from after MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
-1
-FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+0
+FOUND 3 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
+FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 4194304 bytes!/ in mysqld.1.err
+FOUND 1 /InnoDB: Invalid log header checksum/ in mysqld.1.err
# distant future redo log format, with valid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -89,14 +90,14 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
+FOUND 1 /InnoDB: No valid checkpoint was found; the log was created with malicious intentions, or perhaps\./ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 2 /InnoDB: Invalid log header checksum/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with malicious intentions, or perhaps, and it appears corrupted\./ in mysqld.1.err
# same, but with current-version header
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
@@ -104,7 +105,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 3 /InnoDB: Invalid log header checksum/ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=6
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -112,7 +113,7 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
-FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: log sequence number 0.*; transaction id 0/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -141,8 +142,9 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
-FOUND 3 /\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1, and it appears corrupted\./ in mysqld.1.err
+NOT FOUND /InnoDB: Invalid log header checksum
+--source include/search_pattern_in_file.inc
+let SEARCH_PATTERN=\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1, and it appears corrupted\./ in mysqld.1.err
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -165,21 +167,29 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 3 /\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1\./ in mysqld.1.err
# Empty 10.3 redo log
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 1 /InnoDB: .* started; log sequence number 1213964; transaction id 0/ in mysqld.1.err
+FOUND 1 /InnoDB: log sequence number 1213964\b.*; transaction id 0/ in mysqld.1.err
# Empty 10.2 redo log
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+COUNT(*)
+1
+FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+# Empty 10.5 redo log
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
index 8582d5dc713..4643e846be5 100644
--- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result
+++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
@@ -1409,18 +1409,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t0.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t0.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t0",
- "access_type": "ALL",
- "rows": 10,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1440,18 +1446,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "sum(t1.b)"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "sum(t1.b)"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 10,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1469,18 +1481,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "sum(t1.b)"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "sum(t1.b)"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 10,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1503,18 +1521,24 @@ EXPLAIN
"filesort": {
"sort_key": "t1.b",
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.b"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.b"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 10,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1648,18 +1672,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.c, t1.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.c, t1.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1674,18 +1704,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1700,18 +1736,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.c, t1.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.c, t1.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1726,18 +1768,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.c, t1.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.c, t1.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1782,18 +1830,24 @@ EXPLAIN
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.s1, t1.s2"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.s1, t1.s2"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 6,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 6,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -1935,18 +1989,24 @@ EXPLAIN
"select_id": 1,
"duplicate_removal": {
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.part_id, t1.a"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.part_id, t1.a"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 9,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 9,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -2108,18 +2168,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.a, t1.pk"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.a, t1.pk"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 11,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 11,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -2169,18 +2235,24 @@ EXPLAIN
"query_block": {
"select_id": 1,
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "t1.a, t1.b"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "t1.a, t1.b"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 6,
- "filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 6,
+ "filtered": 100
+ }
+ }
+ ]
}
}
}
@@ -3761,29 +3833,35 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
- "sorts": {
- "filesort": {
- "sort_key": "`row_number() OVER()`",
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "r_used_priority_queue": false,
- "r_output_rows": 3,
- "r_buffer_size": "REPLACED",
- "r_sort_mode": "sort_key,rowid"
+ "sorts": [
+ {
+ "filesort": {
+ "sort_key": "`row_number() OVER()`",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 3,
+ "r_buffer_size": "REPLACED",
+ "r_sort_mode": "sort_key,rowid"
+ }
}
- },
+ ],
"temporary_table": {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "r_loops": 1,
- "rows": 3,
- "r_rows": 3,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "filtered": 100,
- "r_filtered": 100
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 3,
+ "r_rows": 3,
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ ]
}
}
}
diff --git a/mysql-test/suite/encryption/t/bulk_insert.opt b/mysql-test/suite/encryption/t/bulk_insert.opt
new file mode 100644
index 00000000000..95455f5f75e
--- /dev/null
+++ b/mysql-test/suite/encryption/t/bulk_insert.opt
@@ -0,0 +1 @@
+--innodb_encrypt_log=1
diff --git a/mysql-test/suite/encryption/t/bulk_insert.test b/mysql-test/suite/encryption/t/bulk_insert.test
new file mode 100644
index 00000000000..ce7804cb4e0
--- /dev/null
+++ b/mysql-test/suite/encryption/t/bulk_insert.test
@@ -0,0 +1,11 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/have_file_key_management_plugin.inc
+
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1 (
+ `id` int(10) unsigned NOT NULL,
+ UNIQUE KEY `id` (`id`)
+) ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq FROM seq_1_to_65536;
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/corrupted_during_recovery.test b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
index bccac2bb182..e4a31a0b478 100644
--- a/mysql-test/suite/encryption/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
@@ -6,7 +6,7 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
-call mtr.add_suppression("InnoDB: Failed to read page [123] from file '.*test.t1\\.ibd': Table is encrypted but decrypt failed");
+call mtr.add_suppression("InnoDB: Failed to read page [123] from file '.*test.t1\\.ibd': Table is compressed or encrypted but uncompress or decrypt failed");
call mtr.add_suppression("InnoDB: The page \\[page id: space=\\d+, page number=3\\] in file '.*test.t1\\.ibd' cannot be decrypted");
call mtr.add_suppression("InnoDB: Table in tablespace \\d+ encrypted. However key management plugin or used key_version \\d+ is not found or used encryption algorithm or method does not match. Can't continue opening the table.");
call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) corrupted page ");
@@ -55,12 +55,12 @@ EOF
SELECT * FROM t1;
--disable_query_log
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[1].ibd looks corrupted; key_version=");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("Table .*t1.* is corrupted. Please drop the table and recreate.");
--enable_query_log
let $restart_parameters=--innodb_force_recovery=1 --skip-innodb-buffer-pool-load-at-startup;
--source include/restart_mysqld.inc
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index 30beff4bd85..05a3b5f4d06 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -10,11 +10,11 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` has an unreadable root page");
+call mtr.add_suppression("Table .*t[12].* is corrupted");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
# for innodb_checksum_algorithm=full_crc32 only
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
@@ -75,32 +75,32 @@ INSERT INTO t2 VALUES ('foobar',1,2);
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t2 where id = 1;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t2 where b = 1;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
INSERT INTO t2 VALUES ('tmp',3,3);
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
DELETE FROM t2 where b = 3;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
DELETE FROM t2 where id = 3;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
UPDATE t2 set b = b +1;
OPTIMIZE TABLE t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t2 ADD COLUMN d INT;
ANALYZE TABLE t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
TRUNCATE TABLE t2;
DROP TABLE t2;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index ad252b6c92f..21a9ddb217d 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -8,13 +8,13 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
# MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
# for innodb_checksum_algorithm=full_crc32 only
@@ -36,7 +36,7 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
SELECT * FROM t1;
--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t1 ENGINE=InnoDB;
--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
@@ -97,7 +97,7 @@ SHOW CREATE TABLE t1;
--error ER_ERROR_ON_RENAME
RENAME TABLE t1 TO t1new;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t1 RENAME TO t1new;
-# Drop should pass even with incorrect keys
+# Drop should succeed even with incorrect keys
DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
index 759f4e58280..c37eb365e7c 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -7,12 +7,12 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
# for innodb_checksum_algorithm=full_crc32 only
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index e5bee99fee2..53fc820a1c9 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -7,11 +7,11 @@
# MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` has an unreadable root page");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
--echo # Start server with keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -48,9 +48,9 @@ SELECT COUNT(1) FROM t3;
SELECT COUNT(1) FROM t2;
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t1 where b = 'ab';
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t1;
--echo
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
index ab77b3747b8..713b98130be 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
@@ -13,6 +13,8 @@ call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) co
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
+call mtr.add_suppression("InnoDB: Missing FILE_CHECKPOINT");
+call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/engines/funcs/r/ix_using_order.result b/mysql-test/suite/engines/funcs/r/ix_using_order.result
index 8d270da1b96..02b34dd4f6c 100644
--- a/mysql-test/suite/engines/funcs/r/ix_using_order.result
+++ b/mysql-test/suite/engines/funcs/r/ix_using_order.result
@@ -17,7 +17,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
- KEY `i1` (`c1`) USING BTREE
+ KEY `i1` (`c1` DESC) USING BTREE
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SHOW TABLES;
@@ -40,7 +40,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
- UNIQUE KEY `i1` (`c1`) USING BTREE
+ UNIQUE KEY `i1` (`c1` DESC) USING BTREE
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP INDEX i1 ON t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
index 8343df73110..b1d455e610a 100644
--- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
+++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
@@ -51,7 +51,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -213,7 +213,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -294,7 +294,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -375,7 +375,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -456,7 +456,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
index 3804f883be0..494a9dfdcdb 100644
--- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
+++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
@@ -46,7 +46,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -117,7 +117,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -188,7 +188,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -330,7 +330,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -401,7 +401,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
diff --git a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
index 89a75bb06af..03f4ccb23df 100644
--- a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
+++ b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
@@ -21,7 +21,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -52,7 +52,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -83,7 +83,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -114,7 +114,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -145,7 +145,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -176,7 +176,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
diff --git a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
index fe9b0ba108f..e2059ff6336 100644
--- a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
+++ b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
@@ -18,7 +18,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -46,7 +46,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -74,7 +74,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -102,7 +102,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -130,7 +130,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -158,7 +158,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
diff --git a/mysql-test/suite/federated/error_row_number.result b/mysql-test/suite/federated/error_row_number.result
new file mode 100644
index 00000000000..a53f3a87a17
--- /dev/null
+++ b/mysql-test/suite/federated/error_row_number.result
@@ -0,0 +1,26 @@
+#
+# MDEV-26654 ROW_NUMBER is wrong upon INSERT into Federated table
+#
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
+CREATE DATABASE federated;
+connection slave;
+CREATE DATABASE federated;
+connection master;
+create table t (pk int primary key);
+create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t';
+insert into tfed values (1),(2),(1);
+ERROR 23000: Can't write; duplicate key in table 'tfed'
+get diagnostics condition 1 @val = row_number;
+# federated is doing bulk insert here, the exact row number is unknown
+select @val;
+@val
+0
+drop table tfed, t;
+connection master;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+connection slave;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/error_row_number.test b/mysql-test/suite/federated/error_row_number.test
new file mode 100644
index 00000000000..8d943589e07
--- /dev/null
+++ b/mysql-test/suite/federated/error_row_number.test
@@ -0,0 +1,18 @@
+--echo #
+--echo # MDEV-26654 ROW_NUMBER is wrong upon INSERT into Federated table
+--echo #
+
+--source suite/federated/have_federatedx.inc
+--source include/federated.inc
+--connection master
+
+create table t (pk int primary key);
+--evalp create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t'
+--error ER_DUP_KEY
+insert into tfed values (1),(2),(1);
+get diagnostics condition 1 @val = row_number;
+--echo # federated is doing bulk insert here, the exact row number is unknown
+select @val;
+
+drop table tfed, t;
+--source include/federated_cleanup.inc
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.result b/mysql-test/suite/federated/federatedx_create_handlers.result
index c0b91a68da7..55756329ff3 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.result
+++ b/mysql-test/suite/federated/federatedx_create_handlers.result
@@ -157,31 +157,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
- "table": {
- "table_name": "t3",
- "access_type": "ALL",
- "rows": 7,
- "filtered": 100
- },
- "table": {
- "table_name": "<derived2>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
- "key_length": "18",
- "used_key_parts": ["name"],
- "ref": ["federated.t3.name"],
- "rows": 2,
- "filtered": 100,
- "materialized": {
- "query_block": {
- "select_id": 2,
- "table": {
- "message": "Pushed derived"
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "rows": 7,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "18",
+ "used_key_parts": ["name"],
+ "ref": ["federated.t3.name"],
+ "rows": 2,
+ "filtered": 100,
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "message": "Pushed derived"
+ }
+ }
}
}
}
- }
+ ]
}
}
ANALYZE
@@ -221,41 +227,47 @@ ANALYZE
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
- "table": {
- "table_name": "t3",
- "access_type": "ALL",
- "r_loops": 1,
- "rows": 7,
- "r_rows": 7,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "filtered": 100,
- "r_filtered": 100
- },
- "table": {
- "table_name": "<derived2>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
- "key_length": "18",
- "used_key_parts": ["name"],
- "ref": ["federated.t3.name"],
- "r_loops": 7,
- "rows": 2,
- "r_rows": 0,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "filtered": 100,
- "r_filtered": 100,
- "materialized": {
- "query_block": {
- "select_id": 2,
- "table": {
- "message": "Pushed derived"
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 7,
+ "r_rows": 7,
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "18",
+ "used_key_parts": ["name"],
+ "ref": ["federated.t3.name"],
+ "r_loops": 7,
+ "rows": 2,
+ "r_rows": 0,
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "message": "Pushed derived"
+ }
+ }
}
}
}
- }
+ ]
}
}
SELECT t.id, federated.t3.name
@@ -346,31 +358,37 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
- "table": {
- "table_name": "t5",
- "access_type": "ALL",
- "rows": 2,
- "filtered": 100
- },
- "block-nl-join": {
- "table": {
- "table_name": "<derived2>",
- "access_type": "ALL",
- "rows": 5,
- "filtered": 100
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t5",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ }
},
- "buffer_type": "flat",
- "buffer_size": "65",
- "join_type": "BNL",
- "materialized": {
- "query_block": {
- "select_id": 2,
+ {
+ "block-nl-join": {
"table": {
- "message": "Pushed derived"
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 5,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "65",
+ "join_type": "BNL",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "message": "Pushed derived"
+ }
+ }
}
}
}
- }
+ ]
}
}
drop table t5;
diff --git a/mysql-test/suite/federated/indexes.result b/mysql-test/suite/federated/indexes.result
new file mode 100644
index 00000000000..d5ebbeeb6dc
--- /dev/null
+++ b/mysql-test/suite/federated/indexes.result
@@ -0,0 +1,33 @@
+#
+# MDEV-27398 DESC index causes wrong (empty) result on Federated tables
+#
+create table t (a int);
+insert into t values (1),(5),(2),(3),(4);
+create table tf (a int, key(a desc)) connection 'mysql://root@127.0.0.1:$MASTER_MYPORT/test/t' engine=Federated;
+select * from tf;
+a
+1
+2
+3
+4
+5
+select * from tf where a > 2;
+a
+3
+4
+5
+select * from tf where a < 3;
+a
+1
+2
+select * from tf where a >= 3;
+a
+3
+4
+5
+select * from tf where a <= 3;
+a
+1
+2
+3
+drop table tf, t;
diff --git a/mysql-test/suite/federated/indexes.test b/mysql-test/suite/federated/indexes.test
new file mode 100644
index 00000000000..2ad2f823acf
--- /dev/null
+++ b/mysql-test/suite/federated/indexes.test
@@ -0,0 +1,22 @@
+--source include/not_embedded.inc
+--source suite/federated/have_federatedx.inc
+
+--echo #
+--echo # MDEV-27398 DESC index causes wrong (empty) result on Federated tables
+--echo #
+
+create table t (a int);
+insert into t values (1),(5),(2),(3),(4);
+
+--evalp create table tf (a int, key(a desc)) connection 'mysql://root@127.0.0.1:$MASTER_MYPORT/test/t' engine=Federated
+--sorted_result
+select * from tf;
+--sorted_result
+select * from tf where a > 2;
+--sorted_result
+select * from tf where a < 3;
+--sorted_result
+select * from tf where a >= 3;
+--sorted_result
+select * from tf where a <= 3;
+drop table tf, t;
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index adf4c2bc10c..b603d36f5ec 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -3322,9 +3322,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
index 36115ecad83..b44ef1fdee2 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index 33fdfe38f87..c2f0bb4a2f0 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
index fb5d105448f..d551575960e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
index 98613a20b49..2a57496800e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_09.result b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
index 6664994543b..89815594a7e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
index de9b73c2bf5..9e09c50d968 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
index fbca906a9fb..beb8ad88de1 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -63,19 +63,19 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = innodb;
Warnings:
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -198,9 +198,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = innodb;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb3.txt'
into table tb3;
drop table if exists tb4;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result
index 5eaa5b08cc2..b33d6a28efb 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -56,22 +56,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = memory;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -188,9 +188,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = memory;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
index 4426583ac4c..e7a8a176188 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -64,22 +64,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -210,9 +210,9 @@ f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index 6faa8d7b51a..d44732f5dd5 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -64,22 +64,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -210,9 +210,9 @@ f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index ef4832cdb8a..b50ae58df28 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -13,9 +13,9 @@ def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql column_stats histogram 11 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL
+def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') select,insert,update,references NEVER NULL
+def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') select,insert,update,references NEVER NULL
def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL
def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL
def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
@@ -345,8 +345,8 @@ NULL mysql column_stats nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats avg_length decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigned
-3.0000 mysql column_stats hist_type enum 14 42 utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB')
-1.0000 mysql column_stats histogram varbinary 255 255 NULL NULL varbinary(255)
+3.0000 mysql column_stats hist_type enum 14 42 utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB')
+1.0000 mysql column_stats histogram longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql db Host char 255 765 utf8mb3 utf8mb3_bin char(255)
3.0000 mysql db Db char 64 192 utf8mb3 utf8mb3_bin char(64)
3.0000 mysql db User char 128 384 utf8mb3 utf8mb3_bin char(128)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index 1a794c2828d..96751dfd176 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -13,9 +13,9 @@ def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql column_stats histogram 11 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL
+def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL
-def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') NEVER NULL
+def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') NEVER NULL
def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL
def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL
def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
@@ -342,8 +342,8 @@ NULL mysql column_stats nulls_ratio decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats avg_length decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4)
NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigned
-3.0000 mysql column_stats hist_type enum 14 42 utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB')
-1.0000 mysql column_stats histogram varbinary 255 255 NULL NULL varbinary(255)
+3.0000 mysql column_stats hist_type enum 14 42 utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB')
+1.0000 mysql column_stats histogram longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql db Host char 255 765 utf8mb3 utf8mb3_bin char(255)
3.0000 mysql db Db char 64 192 utf8mb3 utf8mb3_bin char(64)
3.0000 mysql db User char 128 384 utf8mb3 utf8mb3_bin char(128)
diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
index 056a1fa7559..dba5e7f330e 100644
--- a/mysql-test/suite/funcs_1/r/is_routines_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
@@ -197,7 +197,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -213,7 +213,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -229,7 +229,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index a9b96d15d06..e9b88b9309a 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -3323,9 +3323,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0102.result b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
index 4608fc8302a..975c014512f 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index 07a312e992d..18d55140d67 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
index 7228c4cffd9..ceae360946c 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result
index 32324600ad5..c9d6454dc5b 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_09.result b/mysql-test/suite/funcs_1/r/memory_trig_09.result
index 7579418dc1f..b3e5e109b82 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_09.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
index 41904bf0afd..c1b697bd599 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index a9b96d15d06..e9b88b9309a 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -3323,9 +3323,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
index 4608fc8302a..975c014512f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index 07a312e992d..18d55140d67 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
index 7228c4cffd9..ceae360946c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
index 32324600ad5..c9d6454dc5b 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_09.result b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
index 7579418dc1f..b3e5e109b82 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
index 8302c2bd0f9..cacef967ca9 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
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
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index c9f92d51210..efeb63ae616 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -106,7 +106,7 @@ CALL sp1( 34 );
@v1
3
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
SHOW PROCEDURE STATUS WHERE db = 'db_storedproc';
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
@@ -1430,7 +1430,7 @@ f1
value1
Warnings:
Note 1291 Column 'f1' has duplicated value 'value1' in SET
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
SHOW PROCEDURE STATUS WHERE db = 'db_storedproc';
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
@@ -7110,7 +7110,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7148,7 +7148,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7186,7 +7186,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7224,7 +7224,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7262,7 +7262,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7282,7 +7282,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7293,7 +7293,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7304,7 +7304,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7315,7 +7315,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7326,7 +7326,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7337,7 +7337,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7348,7 +7348,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7359,7 +7359,7 @@ 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 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -13769,7 +13769,7 @@ CALL sp1();
@xx
0
Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13797,7 +13797,7 @@ set @xx = xx;
END//
CALL sp1();
Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
+Warning 1265 Data truncated for column 'xx' at row 0
SELECT @xx;
@xx
t
@@ -13818,7 +13818,7 @@ CALL sp1();
xx
0
Warnings:
-Warning 1366 Incorrect double value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect double value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13846,7 +13846,7 @@ CALL sp1();
xx
0000-00-00 00:00:00
Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
+Warning 1265 Data truncated for column 'xx' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13890,7 +13890,7 @@ CALL sp1();
xx
0
Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -17290,8 +17290,8 @@ CALL sp7(99999999999);
f1
9999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp8;
CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
BEGIN
@@ -17302,7 +17302,7 @@ CALL sp8(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp9;
CREATE PROCEDURE sp9( f1 decimal (0) zerofill)
BEGIN
@@ -17313,8 +17313,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp10;
CREATE PROCEDURE sp10( f1 decimal (0, 0))
BEGIN
@@ -17334,8 +17334,8 @@ CALL sp11(99999999999);
f1
9999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp12;
CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
BEGIN
@@ -17346,7 +17346,7 @@ CALL sp12(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp13;
CREATE PROCEDURE sp13( f1 decimal (0, 0) zerofill)
BEGIN
@@ -17357,8 +17357,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp14;
CREATE PROCEDURE sp14( f1 decimal (63, 30))
BEGIN
@@ -17396,8 +17396,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp18_d;
CREATE PROCEDURE sp18_d( f1 decimal (64))
BEGIN
@@ -17456,7 +17456,7 @@ CALL sp21(1.00e+00);
f1
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp22;
CREATE PROCEDURE sp22( f1 decimal unsigned)
BEGIN
@@ -17467,7 +17467,7 @@ CALL sp22(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp23;
CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
BEGIN
@@ -17478,7 +17478,7 @@ CALL sp23(1.00e+00);
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 0
DROP PROCEDURE IF EXISTS sp24;
CREATE PROCEDURE sp24( f1 decimal zerofill)
BEGIN
@@ -17489,8 +17489,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp25;
CREATE PROCEDURE sp25( f1 double)
BEGIN
@@ -17510,7 +17510,7 @@ CALL sp26(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp27;
CREATE PROCEDURE sp27( f1 double unsigned zerofill)
BEGIN
@@ -17521,7 +17521,7 @@ CALL sp27(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp28;
CREATE PROCEDURE sp28( f1 double zerofill)
BEGIN
@@ -17532,7 +17532,7 @@ CALL sp28(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp29;
CREATE PROCEDURE sp29( f1 float)
BEGIN
@@ -17552,7 +17552,7 @@ CALL sp30(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp31;
CREATE PROCEDURE sp31( f1 float unsigned zerofill)
BEGIN
@@ -17563,7 +17563,7 @@ CALL sp31(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp32;
CREATE PROCEDURE sp32( f1 float zerofill)
BEGIN
@@ -17574,7 +17574,7 @@ CALL sp32(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp33;
CREATE PROCEDURE sp33( f1 float(0))
BEGIN
@@ -17594,7 +17594,7 @@ CALL sp34(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp35;
CREATE PROCEDURE sp35( f1 float(0) unsigned zerofill)
BEGIN
@@ -17605,7 +17605,7 @@ CALL sp35(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp36;
CREATE PROCEDURE sp36( f1 float(0) zerofill)
BEGIN
@@ -17616,7 +17616,7 @@ CALL sp36(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp37;
CREATE PROCEDURE sp37( f1 float(23))
BEGIN
@@ -17636,7 +17636,7 @@ CALL sp38(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp39;
CREATE PROCEDURE sp39( f1 float(23) unsigned zerofill)
BEGIN
@@ -17647,7 +17647,7 @@ CALL sp39(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp40;
CREATE PROCEDURE sp40( f1 float(23) zerofill)
BEGIN
@@ -17658,7 +17658,7 @@ CALL sp40(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp41;
CREATE PROCEDURE sp41( f1 float(24))
BEGIN
@@ -17678,7 +17678,7 @@ CALL sp42(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp43;
CREATE PROCEDURE sp43( f1 float(24) unsigned zerofill)
BEGIN
@@ -17689,7 +17689,7 @@ CALL sp43(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp44;
CREATE PROCEDURE sp44( f1 float(24) zerofill)
BEGIN
@@ -17700,7 +17700,7 @@ CALL sp44(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp45;
CREATE PROCEDURE sp45( f1 float(53))
BEGIN
@@ -17720,7 +17720,7 @@ CALL sp46(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp47;
CREATE PROCEDURE sp47( f1 float(53) unsigned zerofill)
BEGIN
@@ -17731,7 +17731,7 @@ CALL sp47(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp48;
CREATE PROCEDURE sp48( f1 float(53) zerofill)
BEGIN
@@ -17742,7 +17742,7 @@ CALL sp48(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp49;
CREATE PROCEDURE sp49( f1 int)
BEGIN
@@ -17753,8 +17753,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp50;
CREATE PROCEDURE sp50( f1 int unsigned)
BEGIN
@@ -17792,7 +17792,7 @@ CALL sp53(-8388600);
f1
-8388598
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp54;
CREATE PROCEDURE sp54( f1 mediumint unsigned)
BEGIN
@@ -17829,7 +17829,7 @@ CALL sp57(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp58;
CREATE PROCEDURE sp58( f1 numeric (0))
BEGIN
@@ -17840,7 +17840,7 @@ CALL sp58(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp59;
CREATE PROCEDURE sp59( f1 numeric (0) unsigned)
BEGIN
@@ -17851,7 +17851,7 @@ CALL sp59(9999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp60;
CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
BEGIN
@@ -17862,7 +17862,7 @@ CALL sp60(99999999);
f1
0100000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp61;
CREATE PROCEDURE sp61( f1 numeric (0) zerofill)
BEGIN
@@ -17873,8 +17873,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp62;
CREATE PROCEDURE sp62( f1 numeric (0, 0))
BEGIN
@@ -17885,7 +17885,7 @@ CALL sp62(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp63;
CREATE PROCEDURE sp63( f1 numeric (0, 0) unsigned)
BEGIN
@@ -17896,7 +17896,7 @@ CALL sp63(9999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp64;
CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
BEGIN
@@ -17907,7 +17907,7 @@ CALL sp64(99999999);
f1
0100000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp65;
CREATE PROCEDURE sp65( f1 numeric (0, 0) zerofill)
BEGIN
@@ -17918,8 +17918,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp66_n;
CREATE PROCEDURE sp66_n( f1 numeric (63, 30))
BEGIN
@@ -17930,14 +17930,14 @@ CALL sp66_n(-1e+36);
f1
-999999999999999999999999999999989.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp66_n( -1000000000000000000000000000000000000 );
f1
-999999999999999999999999999999989.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp67_nu;
CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
BEGIN
@@ -17948,14 +17948,14 @@ CALL sp67_nu(1e+36);
f1
999999999999999999999999999999999.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp67_nu( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp68_nuz;
CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
BEGIN
@@ -17966,14 +17966,14 @@ CALL sp68_nuz(1e+36);
f1
999999999999999999999999999999999.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp68_nuz( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
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 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp69_n_z;
CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
BEGIN
@@ -17984,14 +17984,14 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp70_n;
CREATE PROCEDURE sp70_n( f1 numeric (64))
BEGIN
@@ -18050,7 +18050,7 @@ CALL sp74(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp75;
CREATE PROCEDURE sp75( f1 numeric unsigned zerofill)
BEGIN
@@ -18061,7 +18061,7 @@ CALL sp75(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp76;
CREATE PROCEDURE sp76( f1 numeric zerofill)
BEGIN
@@ -18072,8 +18072,8 @@ 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
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp77;
CREATE PROCEDURE sp77( f1 real)
BEGIN
@@ -18093,7 +18093,7 @@ CALL sp78(1.1);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp79;
CREATE PROCEDURE sp79( f1 real unsigned zerofill)
BEGIN
@@ -18104,7 +18104,7 @@ CALL sp79(1.1);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp80;
CREATE PROCEDURE sp80( f1 real zerofill)
BEGIN
@@ -18115,7 +18115,7 @@ CALL sp80(1.1);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp81;
CREATE PROCEDURE sp81( f1 smallint)
BEGIN
@@ -18235,7 +18235,7 @@ CALL sp94( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp95;
CREATE PROCEDURE sp95( f1 char ascii)
BEGIN
@@ -18246,7 +18246,7 @@ CALL sp95( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp96;
CREATE PROCEDURE sp96( f1 char binary)
BEGIN
@@ -18257,7 +18257,7 @@ CALL sp96( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp97;
CREATE PROCEDURE sp97( f1 longtext)
BEGIN
@@ -18358,7 +18358,7 @@ CALL sp107(2.00e+13);
f1
returned
Warnings:
-returned 1265 Data truncated for column 'f1' at row 1
+returned 1265 Data truncated for column 'f1' at row 0
USE db_storedproc;
DROP DATABASE db1;
DROP DATABASE IF EXISTS db1;
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 2d68598c03b..bcf6078f624 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -25,4 +25,5 @@ galera_wan : [ERROR] WSREP: /home/buildbot/buildbot/build/gcs/src/gcs_state_msg.
galera_var_ignore_apply_errors : 28: "Server did not transition to READY state"
galera_bf_kill_debug : timeout after 900 seconds
galera_ssl_upgrade : [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 130: Incorrect file format 'gtid_slave_pos'
+galera_parallel_simple : timeout related to wsrep_sync_wait
galera_insert_bulk : MDEV-30536 no expected deadlock in galera_insert_bulk test
diff --git a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc b/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc
deleted file mode 100644
index 726fc6e2b18..00000000000
--- a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require suite/galera/r/have_wsrep_replicate_myisam.require
-disable_query_log;
-SHOW VARIABLES LIKE 'wsrep_replicate_myisam';
-enable_query_log;
diff --git a/mysql-test/suite/galera/r/MDEV-27001.result b/mysql-test/suite/galera/r/MDEV-27001.result
new file mode 100644
index 00000000000..f2dc6a9a937
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-27001.result
@@ -0,0 +1,6 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t3 (c INT) PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (1000));
+CREATE TABLE tp2 (c INT);
+ALTER TABLE t3 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN (2000);
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result
index ae95b832802..98a72c8d46b 100644
--- a/mysql-test/suite/galera/r/MW-416.result
+++ b/mysql-test/suite/galera/r/MW-416.result
@@ -10,16 +10,12 @@ ALTER EVENT ev1 RENAME TO ev2;
ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test'
ALTER FUNCTION fun1 COMMENT 'foo';
ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1'
-ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
-Got one of the listed errors
ALTER PROCEDURE proc1 COMMENT 'foo';
Got one of the listed errors
ALTER SERVER srv OPTIONS (USER 'sally');
Got one of the listed errors
ALTER TABLE tbl DROP COLUMN col;
Got one of the listed errors
-ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
-Got one of the listed errors
ALTER VIEW vw AS SELECT 1;
Got one of the listed errors
CREATE DATABASE db;
@@ -34,14 +30,10 @@ CREATE PROCEDURE proc1() BEGIN END;
Got one of the listed errors
CREATE INDEX idx ON tbl(id);
Got one of the listed errors
-CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
-Got one of the listed errors
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
Got one of the listed errors
CREATE TABLE t (i int);
Got one of the listed errors
-CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
-Got one of the listed errors
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
Got one of the listed errors
CREATE VIEW vw AS SELECT 1;
@@ -54,16 +46,12 @@ DROP FUNCTION fun1;
Got one of the listed errors
DROP INDEX idx ON t0;
Got one of the listed errors
-DROP LOGFILE GROUP lfg;
-Got one of the listed errors
DROP PROCEDURE proc1;
Got one of the listed errors
DROP SERVEr srv;
Got one of the listed errors
DROP TABLE t0;
Got one of the listed errors
-DROP TABLESPACE tblspc;
-Got one of the listed errors
DROP TRIGGER trg;
Got one of the listed errors
DROP VIEW vw;
diff --git a/mysql-test/suite/galera/r/galera_as_slave.result b/mysql-test/suite/galera/r/galera_as_slave.result
index 391ceecd509..1035fe1e9be 100644
--- a/mysql-test/suite/galera/r/galera_as_slave.result
+++ b/mysql-test/suite/galera/r/galera_as_slave.result
@@ -18,6 +18,12 @@ SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
1
connection node_3;
+SET @@session.binlog_alter_two_phase = 1;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+INSERT INTO t1 VALUES (4,1);
+connection node_1;
+connection node_2;
+connection node_3;
DROP TABLE t1;
connection node_2;
STOP SLAVE;
diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
index bc9927b21d9..d6bbcbae680 100644
--- a/mysql-test/suite/galera/r/galera_defaults.result
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -1,9 +1,9 @@
connection node_2;
connection node_1;
# Correct Galera library found
-SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
-expect 51
-51
+SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+expect 50
+49
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME LIKE 'wsrep_%'
@@ -47,7 +47,6 @@ WSREP_ON ON
WSREP_OSU_METHOD TOI
WSREP_RECOVER OFF
WSREP_REJECT_QUERIES NONE
-WSREP_REPLICATE_MYISAM OFF
WSREP_RESTART_SLAVE OFF
WSREP_RETRY_AUTOCOMMIT 1
WSREP_SLAVE_FK_CHECKS ON
@@ -58,7 +57,6 @@ WSREP_SST_AUTH
WSREP_SST_DONOR
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
-WSREP_STRICT_DDL OFF
WSREP_SYNC_WAIT 15
WSREP_TRX_FRAGMENT_SIZE 0
WSREP_TRX_FRAGMENT_UNIT bytes
diff --git a/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-test/suite/galera/r/galera_myisam_transactions.result
index 04f68c29305..6afcda47a23 100644
--- a/mysql-test/suite/galera/r/galera_myisam_transactions.result
+++ b/mysql-test/suite/galera/r/galera_myisam_transactions.result
@@ -38,9 +38,7 @@ COUNT(*) = 0
1
DROP TABLE t1, t2, t3;
SET SESSION lock_wait_timeout=2;
-SET GLOBAL wsrep_replicate_myisam= ON;
-Warnings:
-Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead
+SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
Warnings:
Warning 1280 Name 'pk' ignored for PRIMARY key.
@@ -49,6 +47,4 @@ INSERT INTO t1 VALUES(4);
DEALLOCATE PREPARE stmt;
COMMIT;
DROP TABLE t1;
-SET GLOBAL wsrep_replicate_myisam=OFF;
-Warnings:
-Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead
+SET GLOBAL wsrep_mode = DEFAULT;
diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
index 48625b3ba4a..a15b0c7df69 100644
--- a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
+++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
@@ -10,31 +10,31 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2a;
SET SESSION wsrep_sync_wait=0;
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%';
-COUNT(*) = 1
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
+EXPECT_1
1
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
-COUNT(*) = 1
-1
-SELECT COUNT(*) = 0 FROM t1;
-COUNT(*) = 0
-1
-SELECT COUNT(*) = 0 FROM t2;
-COUNT(*) = 0
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
+EXPECT_1
1
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
+EXPECT_0
+0
+SELECT COUNT(*) AS EXPECT_0 FROM t2;
+EXPECT_0
+0
connection node_2;
UNLOCK TABLES;
connection node_2a;
SET SESSION wsrep_sync_wait = 15;;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
-SELECT COUNT(*) = 1 FROM t2;
-COUNT(*) = 1
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
+EXPECT_1
1
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%';
-COUNT(*) = 2
+SELECT COUNT(*) AS EXPECT_1 FROM t2;
+EXPECT_1
1
+SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification');
+EXPECT_2
+2
SET GLOBAL wsrep_slave_threads = 1;;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result b/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result
deleted file mode 100644
index d53708b3504..00000000000
--- a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result
+++ /dev/null
@@ -1,26 +0,0 @@
-connection node_2;
-connection node_1;
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-0
-SET @@global.wsrep_strict_ddl=ON;
-Warnings:
-Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-STRICT_REPLICATION
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-1
-SET @@global.wsrep_strict_ddl=OFF;
-Warnings:
-Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-0
diff --git a/mysql-test/suite/galera/t/MDEV-27001.opt b/mysql-test/suite/galera/t/MDEV-27001.opt
new file mode 100644
index 00000000000..c62d74cb249
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-27001.opt
@@ -0,0 +1 @@
+--partition=ON \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MDEV-27001.test b/mysql-test/suite/galera/t/MDEV-27001.test
new file mode 100644
index 00000000000..fb5f57f53e5
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-27001.test
@@ -0,0 +1,7 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t3 (c INT) PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (1000));
+CREATE TABLE tp2 (c INT);
+ALTER TABLE t3 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN (2000);
+DROP TABLE t3; \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test
index f9a1b47e2ff..f86ffcbf512 100644
--- a/mysql-test/suite/galera/t/MW-416.test
+++ b/mysql-test/suite/galera/t/MW-416.test
@@ -19,16 +19,12 @@ ALTER EVENT ev1 RENAME TO ev2;
ALTER FUNCTION fun1 COMMENT 'foo';
#--error 1044,1227
#ALTER INSTANCE ROTATE INNODB MASTER KEY;
---error 1044,1227
-ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
--error 1044,1227,1370
ALTER PROCEDURE proc1 COMMENT 'foo';
--error 1044,1227,1370
ALTER SERVER srv OPTIONS (USER 'sally');
--error 1044,1142,1227,1370
ALTER TABLE tbl DROP COLUMN col;
---error 1044,1227,1370
-ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
--error 1044,1142,1227,1370
ALTER VIEW vw AS SELECT 1;
@@ -45,14 +41,10 @@ CREATE PROCEDURE proc1() BEGIN END;
--error 1044,1142,1227,1370
CREATE INDEX idx ON tbl(id);
--error 1044,1142,1227,1370
-CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
---error 1044,1142,1227,1370
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
--error 1044,1142,1227,1370
CREATE TABLE t (i int);
--error 1044,1142,1227,1370
-CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
---error 1044,1142,1227,1370
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
--error 1044,1142,1227,1370
CREATE VIEW vw AS SELECT 1;
@@ -67,16 +59,12 @@ DROP EVENT ev;
DROP FUNCTION fun1;
--error 1044,1142,1227,1370
DROP INDEX idx ON t0;
---error 1044,1142,1227,1370,1064
-DROP LOGFILE GROUP lfg;
--error 1044,1142,1227,1370
DROP PROCEDURE proc1;
--error 1044,1142,1227,1370
DROP SERVEr srv;
--error 1044,1142,1227,1370
DROP TABLE t0;
---error 1044,1142,1227,1370,1064
-DROP TABLESPACE tblspc;
--error 1044,1142,1227,1360,1370
DROP TRIGGER trg;
--error 1044,1142,1227,1370
diff --git a/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-test/suite/galera/t/galera_as_slave.test
index da92437b118..859fe19c9bb 100644
--- a/mysql-test/suite/galera/t/galera_as_slave.test
+++ b/mysql-test/suite/galera/t/galera_as_slave.test
@@ -38,8 +38,24 @@ INSERT INTO t1 VALUES (3);
SELECT COUNT(*) = 3 FROM t1;
--connection node_3
+SET @@session.binlog_alter_two_phase = 1;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+INSERT INTO t1 VALUES (4,1);
+
+--connection node_1
+--let $count = 4
+--let $table = t1
+--source include/wait_until_rows_count.inc
+
+--connection node_2
+--let $count = 4
+--let $table = t1
+--source include/wait_until_rows_count.inc
+
+--connection node_3
DROP TABLE t1;
+
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_backup_stage.test b/mysql-test/suite/galera/t/galera_backup_stage.test
index 31d76816355..20ce6036d0d 100644
--- a/mysql-test/suite/galera/t/galera_backup_stage.test
+++ b/mysql-test/suite/galera/t/galera_backup_stage.test
@@ -56,7 +56,7 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10));
# reach commit stage. In the unlikely case the interleaving is different, the
# result of the test should not change.
--connection node_1c
---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id
+--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id
--source include/wait_condition.inc
@@ -83,11 +83,11 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10));
# wait for insert to get blocked
--connection node_1c
---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id
+--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id
--source include/wait_condition.inc
---let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND State = 'Commit'
+--let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (State = 'Commit' OR State='Waiting for certification')
--source include/wait_condition.inc
# nothing after BLOCK_DDL is applied
diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test
index 96389e44d3f..6b76473d6a6 100644
--- a/mysql-test/suite/galera/t/galera_defaults.test
+++ b/mysql-test/suite/galera/t/galera_defaults.test
@@ -18,7 +18,7 @@ source ../wsrep/include/check_galera_version.inc;
# Global Variables
-SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-test/suite/galera/t/galera_myisam_transactions.test
index 30677ddbe4d..808aebdcbe4 100644
--- a/mysql-test/suite/galera/t/galera_myisam_transactions.test
+++ b/mysql-test/suite/galera/t/galera_myisam_transactions.test
@@ -39,11 +39,11 @@ DROP TABLE t1, t2, t3;
# MDEV-25201 : Assertion `thd->wsrep_trx_meta.gtid.seqno == (-1)' failed in int wsrep_to_isolation_begin(THD*, const char*, const char*, const TABLE_LIST*, Alter_info*)
#
SET SESSION lock_wait_timeout=2;
-SET GLOBAL wsrep_replicate_myisam= ON;
+SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y";
INSERT INTO t1 VALUES(4);
DEALLOCATE PREPARE stmt;
COMMIT;
DROP TABLE t1;
-SET GLOBAL wsrep_replicate_myisam=OFF;
+SET GLOBAL wsrep_mode = DEFAULT;
diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
index 5a33c16c86e..2e9f05cb4af 100644
--- a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
+++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
@@ -32,19 +32,19 @@ INSERT INTO t2 VALUES (1);
--connection node_2a
--sleep 1
SET SESSION wsrep_sync_wait=0;
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%';
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
-SELECT COUNT(*) = 0 FROM t1;
-SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
+SELECT COUNT(*) AS EXPECT_0 FROM t2;
--connection node_2
UNLOCK TABLES;
--connection node_2a
--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig;
-SELECT COUNT(*) = 1 FROM t1;
-SELECT COUNT(*) = 1 FROM t2;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%';
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
+SELECT COUNT(*) AS EXPECT_1 FROM t2;
+SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification');
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test b/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test
deleted file mode 100644
index 2aa76d46f82..00000000000
--- a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test
+++ /dev/null
@@ -1,13 +0,0 @@
---source include/galera_cluster.inc
-
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
-SET @@global.wsrep_strict_ddl=ON;
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
-SET @@global.wsrep_strict_ddl=OFF;
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index ae99ffe98ec..b51d221e72f 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -12,6 +12,8 @@
galera_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
galera_gtid_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
+galera_ipv6_mariabackup : MDEV-24097
+galera_ipv6_mariabackup_section : MDEV-24097, MDEV-22195
galera_vote_rejoin_mysqldump : MDEV-24481: galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
galera_ssl_reload : MDEV-30172 At line 50: mysql_shutdown failed
GCF-354 : mysqltest: At line 39: query 'DROP TABLE test.t1' failed: 1047: WSREP has not yet prepared node for application use
diff --git a/mysql-test/suite/galera_3nodes/r/GCF-363.result b/mysql-test/suite/galera_3nodes/r/GCF-363.result
index d7078227ec3..fb235aceb77 100644
--- a/mysql-test/suite/galera_3nodes/r/GCF-363.result
+++ b/mysql-test/suite/galera_3nodes/r/GCF-363.result
@@ -1,8 +1,9 @@
connection node_2;
connection node_1;
-connection node_1;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_1;
connection node_2;
+connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB;
SET GLOBAL wsrep_on=OFF;
@@ -12,7 +13,6 @@ connection node_2;
SET GLOBAL wsrep_on=OFF;
INSERT INTO t1 VALUES (1, 'a');
SET GLOBAL wsrep_on=ON;
-connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
INSERT INTO t1 VALUES (1, 'b');
SET SESSION wsrep_sync_wait = 0;
diff --git a/mysql-test/suite/galera_3nodes/t/GCF-363.test b/mysql-test/suite/galera_3nodes/t/GCF-363.test
index 5867247e6ee..17c510e7c9c 100644
--- a/mysql-test/suite/galera_3nodes/t/GCF-363.test
+++ b/mysql-test/suite/galera_3nodes/t/GCF-363.test
@@ -5,10 +5,12 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
---connection node_1
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
+--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
@@ -26,7 +28,6 @@ SET GLOBAL wsrep_on=OFF;
INSERT INTO t1 VALUES (1, 'a');
SET GLOBAL wsrep_on=ON;
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
INSERT INTO t1 VALUES (1, 'b');
SET SESSION wsrep_sync_wait = 0;
@@ -72,4 +73,3 @@ CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown");
--connection node_1
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
-
diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
index f4f654c9f46..d4db5b5de76 100644
--- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
+++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
@@ -150,7 +150,7 @@ drop table t2;
--echo FK options
create table t1(a int, b int as (a % 2), c int as (a) stored);
create table t2 (a int);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add constraint foreign key fk(d) references t2(a);
if ($support_virtual_foreign)
{
diff --git a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
index 3f48f86ce7c..3bb44523e64 100644
--- a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
@@ -1192,18 +1192,6 @@ let $values1 = 'any value',default;
let $rows = 1;
--source suite/gcol/inc/gcol_supported_sql_funcs.inc
---echo # DES_ENCRYPT(), DES_DECRYPT()
---source include/have_ssl_crypto_functs.inc
-let $cols = a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual;
-let $values1 = 'MySQL',default;
---disable_warnings
-eval create table t1 ($cols);
-show create table t1;
---enable_warnings
-eval insert into t1 values ($values1);
-select * from t1;
-drop table t1;
-
--echo # INET_ATON(), INET_NTOA()
let $cols = a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual;
let $values1 = '127.0.0.1',default;
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index 06c2553a93c..0228f9be842 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -695,7 +695,7 @@ a b c
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t ADD UNIQUE INDEX (c(1));
Warnings:
-Warning 1264 Out of range value for column 'b' at row 1
+Warning 1264 Out of range value for column 'b' at row 0
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
index 4fc4801482b..9929f4d1eaa 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
@@ -2889,20 +2889,6 @@ a b
any value any value
drop table t1;
set sql_warnings = 0;
-# DES_ENCRYPT(), DES_DECRYPT()
-create table t1 (a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) GENERATED ALWAYS AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-insert into t1 values ('MySQL',default);
-select * from t1;
-a b
-MySQL ÿw2¥ð
-èõÁ
-drop table t1;
# INET_ATON(), INET_NTOA()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual);
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
index 7ddcd4f36ff..802e830a587 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
@@ -2889,20 +2889,6 @@ a b
any value any value
drop table t1;
set sql_warnings = 0;
-# DES_ENCRYPT(), DES_DECRYPT()
-create table t1 (a varchar(1024), b varchar(1024) generated always as (des_encrypt(des_decrypt(a,'adf'),'adf')) virtual);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) GENERATED ALWAYS AS (des_encrypt(des_decrypt(`a`,'adf'),'adf')) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-insert into t1 values ('MySQL',default);
-select * from t1;
-a b
-MySQL ÿw2¥ð
-èõÁ
-drop table t1;
# INET_ATON(), INET_NTOA()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) generated always as (inet_ntoa(inet_aton(a))) virtual);
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index b0c29da2f22..52203c0610c 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -284,7 +284,7 @@ INSERT IGNORE INTO t1 (id, a) VALUES (NULL, -1);
Warnings:
Warning 1264 Out of range value for column 'va' at row 1
ALTER TABLE t1 FORCE;
-ERROR 22003: Out of range value for column 'va' at row 1
+ERROR 22003: Out of range value for column 'va' at row 0
DROP TABLE t1;
#
# MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed
diff --git a/mysql-test/suite/heap/heap_hash.result b/mysql-test/suite/heap/heap_hash.result
index 6bc9ff0d527..e523920bcd0 100644
--- a/mysql-test/suite/heap/heap_hash.result
+++ b/mysql-test/suite/heap/heap_hash.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2;
create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
@@ -467,4 +466,23 @@ SELECT * FROM t1 WHERE c1='bar2';
c1
bar2
DROP TABLE t1;
-End of 5.5 tests
+#
+# End of 5.5 tests
+#
+#
+# MDEV-27406 Index on a HEAP table retains DESC attribute despite being hash
+#
+create table t1 (a int, key(a desc)) engine=memory;
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t1 1 a 1 a NULL 0 NULL NULL YES HASH NO
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+drop table t1;
+#
+# End of 10.8 tests
+#
diff --git a/mysql-test/suite/heap/heap_hash.test b/mysql-test/suite/heap/heap_hash.test
index 3a8979a2393..3d3855d8062 100644
--- a/mysql-test/suite/heap/heap_hash.test
+++ b/mysql-test/suite/heap/heap_hash.test
@@ -2,10 +2,6 @@
# Test of heap tables.
#
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
@@ -346,4 +342,18 @@ explain SELECT * FROM t1 WHERE c1='bar2';
SELECT * FROM t1 WHERE c1='bar2';
DROP TABLE t1;
---echo End of 5.5 tests
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-27406 Index on a HEAP table retains DESC attribute despite being hash
+--echo #
+create table t1 (a int, key(a desc)) engine=memory;
+show index from t1;
+show create table t1;
+drop table t1;
+
+--echo #
+--echo # End of 10.8 tests
+--echo #
diff --git a/mysql-test/suite/innodb/include/have_innodb_bzip2.opt b/mysql-test/suite/innodb/include/have_innodb_bzip2.opt
new file mode 100644
index 00000000000..64680f7b988
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_bzip2.opt
@@ -0,0 +1 @@
+--plugin-load-add=$PROVIDER_BZIP2_SO
diff --git a/mysql-test/suite/innodb/include/have_innodb_lz4.opt b/mysql-test/suite/innodb/include/have_innodb_lz4.opt
new file mode 100644
index 00000000000..eac86deee3a
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lz4.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZ4_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_lzma.opt b/mysql-test/suite/innodb/include/have_innodb_lzma.opt
new file mode 100644
index 00000000000..ecb6bd7a614
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lzma.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZMA_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_lzo.opt b/mysql-test/suite/innodb/include/have_innodb_lzo.opt
new file mode 100644
index 00000000000..6033fc5d81c
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lzo.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZO_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_snappy.opt b/mysql-test/suite/innodb/include/have_innodb_snappy.opt
new file mode 100644
index 00000000000..80c3325a6aa
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_snappy.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_SNAPPY_SO
+
diff --git a/mysql-test/suite/innodb/include/no_checkpoint_end.inc b/mysql-test/suite/innodb/include/no_checkpoint_end.inc
index 4a00dadfd6e..61721650f32 100644
--- a/mysql-test/suite/innodb/include/no_checkpoint_end.inc
+++ b/mysql-test/suite/innodb/include/no_checkpoint_end.inc
@@ -10,12 +10,12 @@ my $cp = $ENV{CHECKPOINT_LSN};
$cp =~ s/^InnoDB\t\t//;
my $log = "$ENV{MYSQLD_DATADIR}ib_logfile0";
open(LOG, "<$log") || die "Unable to open $log";
-seek(LOG, 512, 0) || die "Unable to seek $log";
-die unless read(LOG, $_, 16) == 16;
-my ($no1hi,$no1lo,$cp1hi,$cp1lo) = unpack("N*", $_);
-seek(LOG, 3 * 512, 0) || die "Unable to seek $log";
-die unless read(LOG, $_, 16) == 16;
-my ($no2hi,$no2lo,$cp2hi,$cp2lo) = unpack("N*", $_);
+seek(LOG, 4096, 0) || die "Unable to seek $log";
+die unless read(LOG, $_, 8) == 8;
+my ($cp1hi,$cp1lo) = unpack("NN", $_);
+seek(LOG, 8192, 0) || die "Unable to seek $log";
+die unless read(LOG, $_, 8) == 8;
+my ($cp2hi,$cp2lo) = unpack("NN", $_);
close(LOG);
my $cp1 = $cp1hi << 32 | $cp1lo;
@@ -27,8 +27,7 @@ if ($cp1 > $cp || $cp2 > $cp) {
print OUT "--source include/start_mysqld.inc\n"
unless $ENV{no_checkpoint_kill};
print OUT "$ENV{CLEANUP_IF_CHECKPOINT}\n";
- print OUT "--skip Extra checkpoint 1 after $cp";
- print OUT " ($no1hi:$no1lo=$cp1,$no2hi:$no2lo=$cp2)\n";
+ print OUT "--skip Extra checkpoint 1 after $cp ($cp1,$cp2)\n";
}
close(OUT);
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index 36b582c6d76..0283d1079e1 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -17,7 +17,7 @@ disconnect con1;
SELECT COUNT(*) FROM bug16720368;
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
INSERT INTO bug16720368 VALUES(1);
-ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
+ERROR HY000: Table test/bug16720368 is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368_1 VALUES(1);
# Shut down the server to uncorrupt the data.
# restart
diff --git a/mysql-test/suite/innodb/r/autoinc_persist,desc.rdiff b/mysql-test/suite/innodb/r/autoinc_persist,desc.rdiff
new file mode 100644
index 00000000000..639a60648e4
--- /dev/null
+++ b/mysql-test/suite/innodb/r/autoinc_persist,desc.rdiff
@@ -0,0 +1,769 @@
+@@ -13,212 +13,212 @@
+ #
+ # Pre-create several tables
+ SET SQL_MODE='STRICT_ALL_TABLES';
+-CREATE TABLE t1(a TINYINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++CREATE TABLE t1(a TINYINT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t1 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31);
+ SELECT * FROM t1;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+ 31
+-CREATE TABLE t2(a TINYINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t2(a TINYINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t2 VALUES(-5);
+ ERROR 22003: Out of range value for column 'a' at row 1
+ INSERT INTO t2 VALUES(0), (0), (0), (0), (8), (10), (0),
+ (20), (30), (31);
+ SELECT * FROM t2;
+ a
+-1
+-2
+-3
+-4
+-8
+-10
+-11
+-20
+-30
+ 31
+-CREATE TABLE t3(a SMALLINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++30
++20
++11
++10
++8
++4
++3
++2
++1
++CREATE TABLE t3(a SMALLINT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t3 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31), (1024), (4096);
+ SELECT * FROM t3;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+-31
+-1024
+ 4096
+-CREATE TABLE t4(a SMALLINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
++1024
++31
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t4(a SMALLINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t4 VALUES(-5);
+ ERROR 22003: Out of range value for column 'a' at row 1
+ INSERT INTO t4 VALUES(0), (0), (0), (0), (8), (10), (0),
+ (20), (30), (31), (1024), (4096);
+ SELECT * FROM t4;
+ a
+-1
+-2
+-3
+-4
+-8
+-10
+-11
+-20
+-30
+-31
+-1024
+ 4096
+-CREATE TABLE t5(a MEDIUMINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++1024
++31
++30
++20
++11
++10
++8
++4
++3
++2
++1
++CREATE TABLE t5(a MEDIUMINT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t5 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31), (1000000), (1000005);
+ SELECT * FROM t5;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+-31
+-1000000
+ 1000005
+-CREATE TABLE t6(a MEDIUMINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
++1000000
++31
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t6(a MEDIUMINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t6 VALUES(-5);
+ ERROR 22003: Out of range value for column 'a' at row 1
+ INSERT INTO t6 VALUES(0), (0), (0), (0), (8), (10), (0),
+ (20), (30), (31), (1000000), (1000005);
+ SELECT * FROM t6;
+ a
+-1
+-2
+-3
+-4
+-8
+-10
+-11
+-20
+-30
+-31
+-1000000
+ 1000005
+-CREATE TABLE t7(a INT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++1000000
++31
++30
++20
++11
++10
++8
++4
++3
++2
++1
++CREATE TABLE t7(a INT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t7 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31), (100000000), (100000008);
+ SELECT * FROM t7;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+-31
+-100000000
+ 100000008
+-CREATE TABLE t8(a INT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
++100000000
++31
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t8(a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t8 VALUES(-5);
+ ERROR 22003: Out of range value for column 'a' at row 1
+ INSERT INTO t8 VALUES(0), (0), (0), (0), (8), (10), (0),
+ (20), (30), (31), (100000000), (100000008);
+ SELECT * FROM t8;
+ a
+-1
+-2
+-3
+-4
+-8
+-10
+-11
+-20
+-30
+-31
+-100000000
+ 100000008
+-CREATE TABLE t9(a BIGINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++100000000
++31
++30
++20
++11
++10
++8
++4
++3
++2
++1
++CREATE TABLE t9(a BIGINT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t9 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31), (100000000000), (100000000006);
+ SELECT * FROM t9;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+-31
+-100000000000
+ 100000000006
+-CREATE TABLE t10(a BIGINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
++100000000000
++31
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t10(a BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t10 VALUES(-5);
+ ERROR 22003: Out of range value for column 'a' at row 1
+ INSERT INTO t10 VALUES(0), (0), (0), (0), (8), (10), (0),
+ (20), (30), (31), (100000000000), (100000000006);
+ SELECT * FROM t10;
+ a
+-1
+-2
+-3
+-4
+-8
+-10
+-11
+-20
+-30
+-31
+-100000000000
+ 100000000006
+-CREATE TABLE t11(a FLOAT AUTO_INCREMENT KEY) ENGINE = InnoDB;
++100000000000
++31
++30
++20
++11
++10
++8
++4
++3
++2
++1
++CREATE TABLE t11(a FLOAT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t11 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31);
+ SELECT * FROM t11;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+ 31
+-CREATE TABLE t12(a DOUBLE AUTO_INCREMENT KEY) ENGINE = InnoDB;
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
++CREATE TABLE t12(a DOUBLE AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB;
+ INSERT INTO t12 VALUES(0), (0), (0), (0), (-1), (-10), (0),
+ (20), (30), (31);
+ SELECT * FROM t12;
+ a
+--10
+--1
+-1
+-2
+-3
+-4
+-5
+-20
+-30
+ 31
++30
++20
++5
++4
++3
++2
++1
++-1
++-10
+ # Scenario 1: Normal restart, to test if the counters are persisted
+ # Scenario 2: Delete some values, to test the counters should not be the
+ # one which is the largest in current table
+@@ -242,14 +242,14 @@
+ SELECT MAX(a) AS `Expect 100000000000` FROM t9;
+ Expect 100000000000
+ 100000000000
+-CREATE TABLE t13(a INT AUTO_INCREMENT KEY) ENGINE = InnoDB,
++CREATE TABLE t13(a INT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE = InnoDB,
+ AUTO_INCREMENT = 1234;
+ # restart
+ SHOW CREATE TABLE t13;
+ Table Create Table
+ t13 CREATE TABLE `t13` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=1234 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t13 VALUES(0);
+ SELECT a AS `Expect 1234` FROM t13;
+@@ -464,28 +464,28 @@
+ INSERT INTO t1 VALUES(0), (0);
+ SELECT * FROM t1;
+ a
+-1
+ 2
++1
+ INSERT INTO t3 VALUES(0), (0);
+ SELECT * FROM t3;
+ a
+-1
+ 2
++1
+ INSERT INTO t5 VALUES(0), (0);
+ SELECT * FROM t5;
+ a
+-1
+ 2
++1
+ INSERT INTO t7 VALUES(0), (0);
+ SELECT * FROM t7;
+ a
+-1
+ 2
++1
+ INSERT INTO t9 VALUES(0), (0);
+ SELECT * FROM t9;
+ a
+-1
+ 2
++1
+ # Ensure that all changes before the server is killed are persisted.
+ set global innodb_flush_log_at_trx_commit=1;
+ TRUNCATE TABLE t1;
+@@ -498,63 +498,63 @@
+ INSERT INTO t19 VALUES(0), (0);
+ SELECT * FROM t19;
+ a
+-1
+ 2
++1
+ # restart
+ INSERT INTO t1 VALUES(0), (0);
+ SELECT * FROM t1;
+ a
+-1
+ 2
++1
+ INSERT INTO t3 VALUES(0), (0);
+ SELECT * FROM t3;
+ a
+-1
+ 2
++1
+ INSERT INTO t5 VALUES(0), (0);
+ SELECT * FROM t5;
+ a
+-1
+ 2
++1
+ INSERT INTO t7 VALUES(0), (0);
+ SELECT * FROM t7;
+ a
+-1
+ 2
++1
+ INSERT INTO t19 VALUES(0), (0);
+ SELECT * FROM t19;
+ a
+-1
+-2
+-3
+ 4
++3
++2
++1
+ DELETE FROM t19 WHERE a = 4;
+ RENAME TABLE t19 to t9;
+ INSERT INTO t9 VALUES(0), (0);
+ SELECT * FROM t9;
+ a
+-1
+-2
+-3
+-5
+ 6
++5
++3
++2
++1
+ TRUNCATE TABLE t9;
+ INSERT INTO t9 VALUES(0), (0);
+ SELECT * FROM t9;
+ a
+-1
+ 2
++1
+ # Scenario 8: Test ALTER TABLE operations
+ INSERT INTO t3 VALUES(0), (0), (100), (200), (1000);
+ SELECT * FROM t3;
+ a
+-1
+-2
+-3
+-4
+-100
+-200
+ 1000
++200
++100
++4
++3
++2
++1
+ DELETE FROM t3 WHERE a > 300;
+ SELECT MAX(a) AS `Expect 200` FROM t3;
+ Expect 200
+@@ -566,7 +566,7 @@
+ Table Create Table
+ t3 CREATE TABLE `t3` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t3 VALUES(0);
+ SELECT MAX(a) AS `Expect 201` FROM t3;
+@@ -579,7 +579,7 @@
+ Table Create Table
+ t3 CREATE TABLE `t3` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=500 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t3 VALUES(0);
+ SELECT MAX(a) AS `Expect 500` FROM t3;
+@@ -591,13 +591,13 @@
+ Table Create Table
+ t3 CREATE TABLE `t3` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t3 VALUES(0), (0);
+ SELECT * FROM t3;
+ a
+-100
+ 101
++100
+ INSERT INTO t3 VALUES(150), (180);
+ UPDATE t3 SET a = 200 WHERE a = 150;
+ INSERT INTO t3 VALUES(220);
+@@ -607,7 +607,7 @@
+ Table Create Table
+ t3 CREATE TABLE `t3` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=221 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t3 VALUES(0);
+ SELECT MAX(a) AS `Expect 221` FROM t3;
+@@ -619,7 +619,7 @@
+ Table Create Table
+ t3 CREATE TABLE `t3` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # MDEV-6076: Test adding an AUTO_INCREMENT COLUMN
+ CREATE TABLE mdev6076a (b INT) ENGINE=InnoDB;
+@@ -669,18 +669,18 @@
+ INSERT INTO t_inplace SELECT * FROM t3;
+ SELECT * FROM t_inplace;
+ a
+-100
+-101
+-120
+-121
+-122
+-200
+ 210
++200
++122
++121
++120
++101
++100
+ SHOW CREATE TABLE t_inplace;
+ Table Create Table
+ t_inplace CREATE TABLE `t_inplace` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This will keep the autoinc counter
+ ALTER TABLE t_inplace AUTO_INCREMENT = 250, ALGORITHM = INPLACE;
+@@ -689,7 +689,7 @@
+ Table Create Table
+ t_inplace CREATE TABLE `t_inplace` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This should keep the autoinc counter as well
+ ALTER TABLE t_inplace ADD COLUMN b INT, ALGORITHM = INPLACE;
+@@ -699,16 +699,16 @@
+ t_inplace CREATE TABLE `t_inplace` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+ `b` int(11) DEFAULT NULL,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ DELETE FROM t_inplace WHERE a > 150;
+ SELECT * FROM t_inplace;
+ a b
+-100 NULL
+-101 NULL
+-120 NULL
+-121 NULL
+ 122 NULL
++121 NULL
++120 NULL
++101 NULL
++100 NULL
+ # This should reset the autoinc counter to the one specified
+ # Since it's smaller than current one but bigger than existing
+ # biggest counter in the table
+@@ -719,7 +719,7 @@
+ t_inplace CREATE TABLE `t_inplace` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+ `b` int(11) DEFAULT NULL,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=180 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This should reset the autoinc counter to the next value of
+ # current max counter in the table, since the specified value
+@@ -730,7 +730,7 @@
+ Table Create Table
+ t_inplace CREATE TABLE `t_inplace` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t_inplace VALUES(0), (0);
+ SELECT MAX(a) AS `Expect 124` FROM t_inplace;
+@@ -757,18 +757,18 @@
+ INSERT INTO t_copy SELECT * FROM t3;
+ SELECT * FROM t_copy;
+ a
+-100
+-101
+-120
+-121
+-122
+-200
+ 210
++200
++122
++121
++120
++101
++100
+ SHOW CREATE TABLE t_copy;
+ Table Create Table
+ t_copy CREATE TABLE `t_copy` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This will keep the autoinc counter
+ ALTER TABLE t_copy AUTO_INCREMENT = 250, ALGORITHM = COPY;
+@@ -777,7 +777,7 @@
+ Table Create Table
+ t_copy CREATE TABLE `t_copy` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This should keep the autoinc counter as well
+ ALTER TABLE t_copy ADD COLUMN b INT, ALGORITHM = COPY;
+@@ -787,16 +787,16 @@
+ t_copy CREATE TABLE `t_copy` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+ `b` int(11) DEFAULT NULL,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ DELETE FROM t_copy WHERE a > 150;
+ SELECT * FROM t_copy;
+ a b
+-100 NULL
+-101 NULL
+-120 NULL
+-121 NULL
+ 122 NULL
++121 NULL
++120 NULL
++101 NULL
++100 NULL
+ # This should reset the autoinc counter to the one specified
+ # Since it's smaller than current one but bigger than existing
+ # biggest counter in the table
+@@ -807,7 +807,7 @@
+ t_copy CREATE TABLE `t_copy` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+ `b` int(11) DEFAULT NULL,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=180 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ # This should reset the autoinc counter to the next value of
+ # current max counter in the table, since the specified value
+@@ -818,7 +818,7 @@
+ Table Create Table
+ t_copy CREATE TABLE `t_copy` (
+ `a` smallint(6) NOT NULL AUTO_INCREMENT,
+- PRIMARY KEY (`a`)
++ PRIMARY KEY (`a` DESC)
+ ) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ INSERT INTO t_copy VALUES(0), (0);
+ SELECT MAX(a) AS `Expect 124` FROM t_copy;
+@@ -842,7 +842,7 @@
+ 126
+ DROP TABLE t_copy, it_copy;
+ # Scenario 9: Test the sql_mode = NO_AUTO_VALUE_ON_ZERO
+-CREATE TABLE t30 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT, key(b)) ENGINE = InnoDB;
++CREATE TABLE t30 (a INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(a DESC), b INT, key(b)) ENGINE = InnoDB;
+ set SQL_MODE = NO_AUTO_VALUE_ON_ZERO;
+ INSERT INTO t30 VALUES(NULL, 1), (200, 2), (0, 3);
+ INSERT INTO t30(b) VALUES(4), (5), (6), (7);
+@@ -869,20 +869,20 @@
+ set global innodb_flush_log_at_trx_commit=1;
+ CREATE TABLE t31 (a INT) ENGINE = InnoDB;
+ INSERT INTO t31 VALUES(1), (2);
+-ALTER TABLE t31 ADD b INT AUTO_INCREMENT PRIMARY KEY;
++ALTER TABLE t31 ADD b INT AUTO_INCREMENT, ADD PRIMARY KEY(b DESC);
+ INSERT INTO t31 VALUES(3, 0), (4, NULL), (5, NULL);
+ INSERT INTO t31 VALUES(6, 0);
+ ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+ SELECT * FROM t31;
+ a b
+-3 0
+-1 1
+-2 2
+-4 3
+ 5 4
++4 3
++2 2
++1 1
++3 0
+ SET SQL_MODE = 0;
+ # Scenario 10: Rollback would not rollback the counter
+-CREATE TABLE t32 (a BIGINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
++CREATE TABLE t32 (a BIGINT AUTO_INCREMENT, PRIMARY KEY(a DESC)) ENGINE=InnoDB;
+ INSERT INTO t32 VALUES(0), (0);
+ # Ensure that all changes before the server is killed are persisted.
+ set global innodb_flush_log_at_trx_commit=1;
+@@ -897,7 +897,7 @@
+ # increasing the counter
+ CREATE TABLE t33 (
+ a BIGINT NOT NULL PRIMARY KEY,
+-b BIGINT NOT NULL AUTO_INCREMENT, KEY(b)) ENGINE = InnoDB;
++b BIGINT NOT NULL AUTO_INCREMENT, INDEX(b DESC)) ENGINE = InnoDB;
+ INSERT INTO t33 VALUES(1, NULL);
+ INSERT INTO t33 VALUES(2, NULL);
+ INSERT INTO t33 VALUES(2, NULL);
+@@ -920,13 +920,13 @@
+ INSERT INTO t31(a) VALUES(6), (0);
+ SELECT * FROM t31;
+ a b
+-3 0
+-1 1
+-2 2
+-4 3
+-5 4
+-6 5
+ 0 6
++6 5
++5 4
++4 3
++2 2
++1 1
++3 0
+ DROP TABLE t31;
+ set SQL_MODE = NO_AUTO_VALUE_ON_ZERO;
+ DELETE FROM t30 WHERE a = 0;
+@@ -965,7 +965,7 @@
+ DROP TABLE t33;
+ CREATE TABLE t33 (
+ a BIGINT NOT NULL PRIMARY KEY,
+-b BIGINT NOT NULL AUTO_INCREMENT, KEY(b)) ENGINE = InnoDB;
++b BIGINT NOT NULL AUTO_INCREMENT, INDEX(b DESC)) ENGINE = InnoDB;
+ ALTER TABLE t33 DISCARD TABLESPACE;
+ restore: t33 .ibd and .cfg files
+ ALTER TABLE t33 IMPORT TABLESPACE;
+@@ -975,7 +975,7 @@
+ 4
+ SELECT * FROM t33;
+ a b
+-10 1
+-2 2
+ 3 4
++2 2
++10 1
+ DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t30, t32, t33;
diff --git a/mysql-test/suite/innodb/r/autoinc_persist.result b/mysql-test/suite/innodb/r/autoinc_persist.result
index 93594db3f05..9e5cd4ad23e 100644
--- a/mysql-test/suite/innodb/r/autoinc_persist.result
+++ b/mysql-test/suite/innodb/r/autoinc_persist.result
@@ -242,7 +242,7 @@ DELETE FROM t9 WHERE a > 100000000000;
SELECT MAX(a) AS `Expect 100000000000` FROM t9;
Expect 100000000000
100000000000
-CREATE TABLE t13(a INT AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB,
+CREATE TABLE t13(a INT AUTO_INCREMENT KEY) ENGINE = InnoDB,
AUTO_INCREMENT = 1234;
# restart
SHOW CREATE TABLE t13;
@@ -882,8 +882,7 @@ a b
5 4
SET SQL_MODE = 0;
# Scenario 10: Rollback would not rollback the counter
-CREATE TABLE t32 (
-a BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+CREATE TABLE t32 (a BIGINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t32 VALUES(0), (0);
# Ensure that all changes before the server is killed are persisted.
set global innodb_flush_log_at_trx_commit=1;
@@ -898,8 +897,7 @@ ROLLBACK;
# increasing the counter
CREATE TABLE t33 (
a BIGINT NOT NULL PRIMARY KEY,
-b BIGINT NOT NULL AUTO_INCREMENT,
-KEY(b)) ENGINE = InnoDB;
+b BIGINT NOT NULL AUTO_INCREMENT, KEY(b)) ENGINE = InnoDB;
INSERT INTO t33 VALUES(1, NULL);
INSERT INTO t33 VALUES(2, NULL);
INSERT INTO t33 VALUES(2, NULL);
@@ -967,8 +965,7 @@ UNLOCK TABLES;
DROP TABLE t33;
CREATE TABLE t33 (
a BIGINT NOT NULL PRIMARY KEY,
-b BIGINT NOT NULL AUTO_INCREMENT,
-KEY(b)) ENGINE = InnoDB;
+b BIGINT NOT NULL AUTO_INCREMENT, KEY(b)) ENGINE = InnoDB;
ALTER TABLE t33 DISCARD TABLESPACE;
restore: t33 .ibd and .cfg files
ALTER TABLE t33 IMPORT TABLESPACE;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff
new file mode 100644
index 00000000000..b729890c354
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lz4
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lz4 reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lz4";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lz4 ON
++# Innodb_compression_algorithm can be set to lz4
++SET GLOBAL Innodb_compression_algorithm = lz4;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff
new file mode 100644
index 00000000000..caba4283977
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzma
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzma reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzma";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lzma ON
++# Innodb_compression_algorithm can be set to lzma
++SET GLOBAL Innodb_compression_algorithm = lzma;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff
new file mode 100644
index 00000000000..8a1a5403fc2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzo
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzo reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzo";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lzo ON
++# Innodb_compression_algorithm can be set to lzo
++SET GLOBAL Innodb_compression_algorithm = lzo;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff
new file mode 100644
index 00000000000..4a1261d45d2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: snappy
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_snappy reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_snappy";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_snappy ON
++# Innodb_compression_algorithm can be set to snappy
++SET GLOBAL Innodb_compression_algorithm = snappy;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded.result b/mysql-test/suite/innodb/r/compression_providers_loaded.result
new file mode 100644
index 00000000000..2d1700c2ae2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded.result
@@ -0,0 +1,10 @@
+#
+# Testing unloaded compression provider: bzip2
+#
+# Innodb_have_bzip2 reflects that the provider is loaded
+SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
+Variable_name Value
+Innodb_have_bzip2 ON
+# Innodb_compression_algorithm can be set to bzip2
+SET GLOBAL Innodb_compression_algorithm = bzip2;
+SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff
new file mode 100644
index 00000000000..e849fb5c474
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lz4
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lz4 reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lz4";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lz4 OFF
++# Innodb_compression_algorithm cannot be set to lz4
++SET GLOBAL Innodb_compression_algorithm = lz4;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lz4 (2) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff
new file mode 100644
index 00000000000..466fb37c3fb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzma
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzma reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzma";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lzma OFF
++# Innodb_compression_algorithm cannot be set to lzma
++SET GLOBAL Innodb_compression_algorithm = lzma;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lzma'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lzma (4) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lzma'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff
new file mode 100644
index 00000000000..dec0becf71e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzo
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzo reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzo";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lzo OFF
++# Innodb_compression_algorithm cannot be set to lzo
++SET GLOBAL Innodb_compression_algorithm = lzo;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lzo'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lzo (3) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lzo'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff
new file mode 100644
index 00000000000..273ff4e2131
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: snappy
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_snappy reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_snappy";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_snappy OFF
++# Innodb_compression_algorithm cannot be set to snappy
++SET GLOBAL Innodb_compression_algorithm = snappy;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'snappy'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm snappy (6) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'snappy'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded.result b/mysql-test/suite/innodb/r/compression_providers_unloaded.result
new file mode 100644
index 00000000000..d4ac9cdb41c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded.result
@@ -0,0 +1,14 @@
+#
+# Testing unloaded compression provider: bzip2
+#
+# Innodb_have_bzip2 reflects that the provider is not loaded
+SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
+Variable_name Value
+Innodb_have_bzip2 OFF
+# Innodb_compression_algorithm cannot be set to bzip2
+SET GLOBAL Innodb_compression_algorithm = bzip2;
+ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
+show warnings;
+Level Code Message
+Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
diff --git a/mysql-test/suite/innodb/r/corrupted_during_recovery.result b/mysql-test/suite/innodb/r/corrupted_during_recovery.result
index 951233ced3c..d67dc8a63d8 100644
--- a/mysql-test/suite/innodb/r/corrupted_during_recovery.result
+++ b/mysql-test/suite/innodb/r/corrupted_during_recovery.result
@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
a
1
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 5bcb7cf963f..16c33ee02a2 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1068,7 +1068,7 @@ ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'b' at row 0
SELECT * FROM t1;
a b
10 10:20:30
diff --git a/mysql-test/suite/innodb/r/innodb-index,debug.rdiff b/mysql-test/suite/innodb/r/innodb-index,debug.rdiff
deleted file mode 100644
index 2740e440cd5..00000000000
--- a/mysql-test/suite/innodb/r/innodb-index,debug.rdiff
+++ /dev/null
@@ -1,10 +0,0 @@
---- innodb-index.result
-+++ innodb-index.reject
-@@ -1851,6 +1851,7 @@
- #
- # MDEV-15325 Incomplete validation of missing tablespace during recovery
- #
-+SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus';
- CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB;
- CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB;
- # Kill the server
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 2292188c8ac..a76837b91a2 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1947,3 +1947,51 @@ Warnings:
Warning 1082 InnoDB: Table test/t contains 0 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB
Warning 1082 InnoDB: Table test/t contains 0 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB
DROP TABLE t;
+#
+# MDEV-27374 InnoDB table becomes corrupt after renaming DESC-indexed column
+#
+CREATE TABLE t1 (a VARCHAR(8), PRIMARY KEY(a DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 RENAME COLUMN a TO b, ALGORITHM=INPLACE;
+SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
+SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
+NAME
+b
+DROP TABLE t1;
+#
+# MDEV-27432 ASC/DESC primary and unique keys cause index
+# inconsistency between InnoDB and server
+#
+CREATE TABLE t1 (id INT NOT NULL, UNIQUE(id DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD PRIMARY KEY (id), ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `id` (`id` DESC)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+#
+# MDEV-27445 Index inconsistency and assertion failure after
+# renaming virtual column with DESC key
+#
+CREATE TABLE t1(a INT, b INT AS (a), KEY(a, b DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 RENAME COLUMN IF EXISTS b TO v;
+ALTER TABLE t1 FORCE;
+DROP TABLE t1;
+#
+# MDEV-27592 DESC primary index fails to set wide format
+# while renaming the column
+#
+CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(8), b INT, KEY(a DESC,b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'foo',10);
+ALTER TABLE t1 RENAME COLUMN b TO c, ALGORITHM=INPLACE;
+SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
+SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id ORDER BY INDEX_ID DESC LIMIT 1;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
+NAME
+a
+c
+DROP TABLE t1;
+# End of 10.8 tests
diff --git a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
index 9e0dbf49931..6a57be49ac5 100644
--- a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
+++ b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
@@ -42,7 +42,7 @@ drop table t1;
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN b LINESTRING DEFAULT POINT(1,1);
-ERROR 22007: Incorrect LINESTRING value: 'POINT(1 1)' for column ``.``.`b` at row 1
+ERROR 22007: Incorrect LINESTRING value: 'POINT(1 1)' for column ``.``.`b` at row 0
DESCRIBE t1;
Field Type Null Key Default Extra
a int(11) YES NULL
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index 5770ebb27db..e7af2d9469e 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -1,5 +1,5 @@
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
-call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*");
call mtr.add_suppression("InnoDB: Ignoring tablespace .* because it could not be opened.");
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize.result
index 667d31a0b69..cafa3f45eab 100644
--- a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize.result
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize.result
@@ -3,22 +3,20 @@ select @@innodb_buffer_pool_size;
@@innodb_buffer_pool_size
8388608
set global innodb_buffer_pool_size = 10485760;
-Warnings:
-Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '10485760'
select @@innodb_buffer_pool_size;
@@innodb_buffer_pool_size
-16777216
+10485760
create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
create or replace view view0 as select 1 union all select 1;
set @`v_id` := 0;
set @`v_val` := 0;
replace into t1 select (@`v_id` := (@`v_id` + 4) mod 4294967296) as id, (@`v_val` := (@`v_val` + 4) mod 4294967296) as val from view0 v0, view0 v1, view0 v2, view0 v3, view0 v4, view0 v5, view0 v6, view0 v7, view0 v8, view0 v9, view0 v10, view0 v11, view0 v12, view0 v13, view0 v14, view0 v15, view0 v16, view0 v17;
-set global innodb_buffer_pool_size = 7340032;
+set global innodb_buffer_pool_size = 64 * 1024 * 1024 + 512 * 1024;
Warnings:
-Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '7340032'
+Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '67633152'
select @@innodb_buffer_pool_size;
@@innodb_buffer_pool_size
-8388608
+68157440
select count(val) from t1;
count(val)
262144
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index b00c80643c0..4c89ad4b9fb 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 9bdb546482e..dd253311ddd 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -154,9 +154,6 @@ os_data_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status
os_pending_reads os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of reads pending
os_pending_writes os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of writes pending
os_log_bytes_written os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Bytes of log written (innodb_os_log_written)
-os_log_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of fsync log writes (innodb_os_log_fsyncs)
-os_log_pending_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pending fsync write (innodb_os_log_pending_fsyncs)
-os_log_pending_writes os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pending log file writes (innodb_os_log_pending_writes)
trx_rw_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of read-write transactions committed
trx_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of read-only transactions committed
trx_nl_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of non-locking auto-commit read-only transactions committed
@@ -174,20 +171,16 @@ purge_undo_log_pages purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL
purge_dml_delay_usec purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Microseconds DML to be delayed due to purge lagging
purge_stop_count purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of times purge was stopped
purge_resume_count purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of times purge was resumed
-log_checkpoints recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of checkpoints
+log_checkpoints recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of checkpoints
log_lsn_last_flush recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN of Last flush
log_lsn_last_checkpoint recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN at last checkpoint
log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value minus LSN at last checkpoint
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value The oldest modified block LSN in the buffer pool
log_max_modified_age_async recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Maximum LSN difference; when exceeded, start asynchronous preflush
-log_pending_log_flushes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Pending log flushes
-log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Pending checkpoints
-log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of log I/Os
log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log waits due to small log buffer (innodb_log_waits)
log_write_requests recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log write requests (innodb_log_write_requests)
log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log writes (innodb_log_writes)
-log_padded recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Bytes of log padded for log write ahead
compress_pages_compressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of pages compressed
compress_pages_decompressed compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of pages decompressed
compression_pad_increments compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times padding is incremented to avoid compression failures
diff --git a/mysql-test/suite/innodb/r/innodb_status_variables.result b/mysql-test/suite/innodb/r/innodb_status_variables.result
index 5b8ca678795..dd3d3ca1dd2 100644
--- a/mysql-test/suite/innodb/r/innodb_status_variables.result
+++ b/mysql-test/suite/innodb/r/innodb_status_variables.result
@@ -65,9 +65,6 @@ INNODB_MASTER_THREAD_ACTIVE_LOOPS
INNODB_MASTER_THREAD_IDLE_LOOPS
INNODB_MAX_TRX_ID
INNODB_MEM_DICTIONARY
-INNODB_OS_LOG_FSYNCS
-INNODB_OS_LOG_PENDING_FSYNCS
-INNODB_OS_LOG_PENDING_WRITES
INNODB_OS_LOG_WRITTEN
INNODB_PAGE_SIZE
INNODB_PAGES_CREATED
diff --git a/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff b/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff
new file mode 100644
index 00000000000..9d40decbb30
--- /dev/null
+++ b/mysql-test/suite/innodb/r/insert_into_empty,32k.rdiff
@@ -0,0 +1,9 @@
+@@ -377,8 +377,6 @@
+ c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB;
+ SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT;
+ ALTER TABLE t1 FORCE;
+-Warnings:
+-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT IGNORE INTO t1 VALUES
+ (1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)),
+ (2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107));
diff --git a/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff b/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff
new file mode 100644
index 00000000000..9d40decbb30
--- /dev/null
+++ b/mysql-test/suite/innodb/r/insert_into_empty,64k.rdiff
@@ -0,0 +1,9 @@
+@@ -377,8 +377,6 @@
+ c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB;
+ SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT;
+ ALTER TABLE t1 FORCE;
+-Warnings:
+-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ INSERT IGNORE INTO t1 VALUES
+ (1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)),
+ (2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107));
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index ef7d015f7f3..45f3dd7654c 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -194,8 +194,8 @@ CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB
STATS_PERSISTENT=1 STATS_AUTO_RECALC=1;
INSERT INTO t1 SELECT * FROM seq_1_to_4096;
# Wait till statistics update after bulk insert operation
-SELECT n_rows>=4096 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1";
-n_rows>=4096
+SELECT n_rows>=4000 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1";
+n_rows>=4000
1
DROP TABLE t1;
#
@@ -223,7 +223,7 @@ INSERT INTO t VALUES (0,0);
ERROR 21S01: Column count doesn't match value count at row 1
SAVEPOINT a;
INSERT INTO t VALUES (0),(0);
-ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
SAVEPOINT a;
commit;
SELECT * FROM t;
@@ -252,3 +252,211 @@ c1
3331
DROP TABLE t1;
# End of 10.6 tests
+#
+# MDEV-26947 UNIQUE column checks fail in InnoDB resulting
+# in table corruption
+#
+CREATE TABLE t (c1 INT KEY,c2 INT UNIQUE) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t VALUES (1,0),(2,0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+COMMIT;
+DROP TABLE t;
+CREATE TABLE t (i INT UNIQUE)ENGINE=InnoDB;
+INSERT INTO t VALUES (0),(0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+DROP TABLE t;
+CREATE TABLE t (c INT PRIMARY KEY,c2 CHAR(1) UNIQUE)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t VALUES(1, ''),(2, '');
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+SELECT * FROM t;
+c c2
+DELETE FROM t;
+COMMIT;
+DROP TABLE t;
+#
+# MDEV-26956 LeakSanitizer/Valgrind errors in
+# trx_mod_table_time_t::start_bulk_insert
+# upon adding system versioning
+#
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
+#
+# MDEV-27316 Assertion `!(index)->is_spatial()' failed.
+#
+CREATE TABLE t (c POINT NOT NULL, SPATIAL INDEX(c)) ENGINE=InnoDB;
+INSERT INTO t VALUES (POINT(1, 1));
+SELECT COUNT(*) FROM t WHERE MBRWithin(t.c, POINT(1,1));
+COUNT(*)
+1
+DROP TABLE t;
+#
+# MDEV-27318 Assertion data_size < srv_sort_buf_size failed in row_merge_bulk_buf_add
+#
+CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(REPEAT(1, 8459264));
+SELECT length(f1) FROM t1;
+length(f1)
+8459264
+DROP TABLE t1;
+#
+# MDEV-27858 Assertion `page_dir_get_n_heap(new_page) == 2U' failed in PageBulk::init
+#
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+LOCK TABLES t1 WRITE,t2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DROP TABLE t2, t1;
+#
+# MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_space
+#
+CREATE TABLE t1(
+f1 SERIAL,
+f2 LINESTRING NOT NULL DEFAULT LineFromText('LINESTRING(1 1,2 2,3 3)'),
+SPATIAL INDEX(f2))ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(0), (1), (2);
+ERROR 23000: Duplicate entry '1' for key 'f1'
+DROP TABLE t1;
+#
+# MDEV-28237 Assertion `0' failed in row_upd_sec_index_entry on DELETE
+#
+CREATE TABLE t1 (c0 YEAR UNIQUE) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(0),(0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+DELETE FROM t1;
+DROP TABLE t1;
+#
+# MDEV-28037 Assertion `trx->bulk_insert' failed in innodb_prepare_commit_versioned
+#
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW UPDATE t2 SET c=1;
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+c
+0
+SELECT * FROM t2;
+c
+DROP TABLE t2, t1;
+#
+# MDEV-28242 Assertion `!check_foreigns' failed in
+# trx_t::check_bulk_buffer
+#
+CREATE TABLE t1 (c INT)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1), (1);
+SET SESSION foreign_key_checks=TRUE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE TABLE t2(d INT)ENGINE=InnoDB;
+DROP TABLE t2, t1;
+#
+# MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
+#
+SET SESSION foreign_key_checks=0;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1),(2);
+ALTER TABLE t1 REBUILD PARTITION p0;
+DROP TABLE t1;
+#
+# MDEV-29570 InnoDB fails to clean bulk buffer when server
+# does rollback operation
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB
+PARTITION BY RANGE (pk) (
+PARTITION pn VALUES LESS THAN (20));
+INSERT INTO t1 VALUES (1),(21);
+ERROR HY000: Table has no partition for value 21
+DROP TABLE t1;
+#
+# MDEV-29761 Bulk insert fails to rollback
+# during insert..select
+#
+CREATE TABLE t1 (f1 INT)ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INT, UNIQUE INDEX(f1)) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(1);
+BEGIN;
+INSERT t1 SELECT 1 FROM seq_1_to_2;
+COMMIT;
+SELECT * FROM t1;
+f1
+SELECT * FROM t2;
+f1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+CHECK TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+DROP TABLE t1, t2;
+#
+# MDEV-29801 Inconsistent ER_TOO_BIG_ROWSIZE during bulk
+# insert operation
+#
+call mtr.add_suppression("InnoDB: Cannot add field `(c0[36]|c11)` in table");
+SET @format= @@innodb_default_row_format;
+CREATE TABLE t1 (pk int primary key, c01 text, c02 text, c03 text,
+c04 text, c05 text, c06 text, c07 text, c08 text,
+c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB;
+SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT;
+ALTER TABLE t1 FORCE;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+INSERT IGNORE INTO t1 VALUES
+(1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)),
+(2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107));
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format;
+#
+# MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file()
+#
+CREATE TABLE t1 (
+`id` int(11) NOT NULL,
+`data` LONGBLOB NOT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(1, REPEAT('X', @@innodb_sort_buffer_size)),
+(2, REPEAT('X', @@innodb_sort_buffer_size));
+SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size);
+nb_corrupted_rows
+0
+DROP TABLE t1;
+# End of 10.7 tests
+#
+# MDEV-30426 Assertion !rec_offs_nth_extern(offsets2, n)
+# during bulk insert
+#
+CREATE TABLE t1(f1 TEXT NOT NULL, f2 TEXT NOT NULL,
+f3 TEXT NOT NULL, f4 TEXT NOT NULL,
+f5 TEXT NOT NULL, f6 TEXT NOT NULL,
+PRIMARY KEY(f6(10)))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES
+(repeat('a', 200), repeat('b', 200), repeat('c', 200),
+repeat('d', 200), repeat('e', 200), repeat('f', 200)),
+(repeat('b', 20000), repeat('c', 16000), repeat('d', 12000),
+repeat('e', 12000), repeat('f', 12000), repeat('f', 12000));
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+COMMIT;
+DROP TABLE t1;
+# End of 10.8 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index 4a67e04205b..18680432c77 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -314,12 +314,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -1248,12 +1248,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -2182,12 +2182,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result
index e1ef373af06..3e7ee35fdc1 100644
--- a/mysql-test/suite/innodb/r/instant_alter_import.result
+++ b/mysql-test/suite/innodb/r/instant_alter_import.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("Operating system error number .* in a file operation.");
call mtr.add_suppression("The error means the system cannot find the path specified.");
-call mtr.add_suppression("File ./test/t1.ibd: 'delete' returned OS error");
+call mtr.add_suppression("File ./test/t1.ibd was not found");
set default_storage_engine=innodb;
#
# MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
diff --git a/mysql-test/suite/innodb/r/log_corruption.result b/mysql-test/suite/innodb/r/log_corruption.result
index bf92f77d30c..df58a90dcec 100644
--- a/mysql-test/suite/innodb/r/log_corruption.result
+++ b/mysql-test/suite/innodb/r/log_corruption.result
@@ -12,16 +12,15 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
-FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log block
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
+FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
# empty redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
@@ -29,53 +28,55 @@ COUNT(*)
1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Corrupted multi-file redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 2 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
-# Empty multi-file redo log from before MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
+# Empty multi-file redo log (wrong offset) from before MariaDB 10.2.2
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
-1
-FOUND 2 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+0
+FOUND 3 /Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint\./ in mysqld.1.err
# Multi-file redo log with size mismatch from after MariaDB 10.2.2
# Corrupted multi-file redo log from after MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!/ in mysqld.1.err
-FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+FOUND 3 /Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint\./ in mysqld.1.err
+FOUND 1 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
-FOUND 2 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
+FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 1048576 bytes!/ in mysqld.1.err
+FOUND 2 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
# Empty multi-file redo log from after MariaDB 10.2.2
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
-1
-FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+0
+FOUND 3 /InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\.2\.3\.4\./ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
+FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 4194304 bytes!/ in mysqld.1.err
+FOUND 1 /InnoDB: Invalid log header checksum/ in mysqld.1.err
# distant future redo log format, with valid header checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -89,14 +90,14 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
+FOUND 1 /InnoDB: No valid checkpoint was found; the log was created with malicious intentions, or perhaps\./ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 2 /InnoDB: Invalid log header checksum/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with malicious intentions, or perhaps, and it appears corrupted\./ in mysqld.1.err
# same, but with current-version header
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
@@ -104,7 +105,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 2 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
+FOUND 3 /InnoDB: Invalid log header checksum/ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=6
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -112,7 +113,7 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
-FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: log sequence number 0.*; transaction id 0/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -141,8 +142,9 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
-FOUND 3 /\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1, and it appears corrupted\./ in mysqld.1.err
+NOT FOUND /InnoDB: Invalid log header checksum
+--source include/search_pattern_in_file.inc
+let SEARCH_PATTERN=\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1, and it appears corrupted\./ in mysqld.1.err
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -165,21 +167,29 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 3 /\[ERROR\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1\./ in mysqld.1.err
# Empty 10.3 redo log
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 1 /InnoDB: .* started; log sequence number 1213964; transaction id 0/ in mysqld.1.err
+FOUND 1 /InnoDB: log sequence number 1213964\b.*; transaction id 0/ in mysqld.1.err
# Empty 10.2 redo log
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+COUNT(*)
+1
+FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+# Empty 10.5 redo log
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
-FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
+FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
diff --git a/mysql-test/suite/innodb/r/log_file.result b/mysql-test/suite/innodb/r/log_file.result
index 642ba41d97f..734e9b07687 100644
--- a/mysql-test/suite/innodb/r/log_file.result
+++ b/mysql-test/suite/innodb/r/log_file.result
@@ -15,7 +15,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+/ in mysqld.1.err
+FOUND 1 /Cannot create /path/to/non-existent/ib_logfile101/ in mysqld.1.err
# Successfully let InnoDB create tablespaces
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
@@ -255,7 +255,6 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
bak_ib_logfile0
bak_ibdata1
bak_ibdata2
@@ -263,7 +262,6 @@ bak_undo001
bak_undo002
bak_undo003
ib_buffer_pool
-ib_logfile0
ibdata1
ibdata2
undo001
@@ -289,7 +287,6 @@ WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
1
1
-NOT FOUND /Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+/ in mysqld.1.err
# restart
# Cleanup
bak_ib_logfile0
diff --git a/mysql-test/suite/innodb/r/log_file_name_debug.result b/mysql-test/suite/innodb/r/log_file_name_debug.result
deleted file mode 100644
index e5c1def8f8e..00000000000
--- a/mysql-test/suite/innodb/r/log_file_name_debug.result
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Bug#19685095 DO NOT CARE ABOUT UNRESOLVED MLOG_FILE_NAME
-# IF THERE ARE NO OPERATIONS TO APPLY
-#
-SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus';
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
-# Kill the server
-# restart: --debug=d,innodb_log_abort_1 --innodb-log-file-size=4194304
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_3 --innodb-log-file-size=4194304
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-# restart
-# restart
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/log_file_size.result b/mysql-test/suite/innodb/r/log_file_size.result
index a0ab35d5c43..7b4935e1ab1 100644
--- a/mysql-test/suite/innodb/r/log_file_size.result
+++ b/mysql-test/suite/innodb/r/log_file_size.result
@@ -1,5 +1,5 @@
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
-# restart: --innodb-log-file-size=2m
+# restart: --innodb-log-file-size=4m
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -35,61 +35,32 @@ FOUND 1 /syntax error in innodb_log_group_home_dir/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=.*/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_3
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
# restart: --innodb-read-only
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_4
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 5 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_5
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 6 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
+FOUND 1 /redo log from 5\.000MiB to [0-9.]*[KMGT]iB/ in mysqld.1.err
# restart: --innodb-read-only
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 2 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_6
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 7 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_7
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-# restart: --innodb-read-only
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Cannot create log file in read-only mode/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_8
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_9
-SELECT * FROM t1;
-ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_9
+# restart
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of 512 bytes/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_9
-SELECT * FROM t1;
-a
-42
-123
-# restart: --debug=d,innodb_log_abort_10
+FOUND 1 /InnoDB: File .*ib_logfile0 is too small/ in mysqld.1.err
+# restart
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
-FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
-FOUND 1 /InnoDB: Renaming log file .*ib_logfile101 to .*ib_logfile0/ in mysqld.1.err
+FOUND 1 /InnoDB: Expecting only ib_logfile0/ in mysqld.1.err
+# restart
+FOUND 1 /InnoDB: File .*ib_logfile0 was not found/ in mysqld.1.err
# restart
SELECT * FROM t1;
a
42
123
DROP TABLE t1;
+FOUND 2 /InnoDB: Resizing redo log from 5\.000MiB to [0-9.]*[KMGT]iB; LSN=\d+\b/ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result
index c874a84d26b..221c92faaea 100644
--- a/mysql-test/suite/innodb/r/monitor.result
+++ b/mysql-test/suite/innodb/r/monitor.result
@@ -120,9 +120,6 @@ os_data_fsyncs disabled
os_pending_reads disabled
os_pending_writes disabled
os_log_bytes_written disabled
-os_log_fsyncs disabled
-os_log_pending_fsyncs disabled
-os_log_pending_writes disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -147,13 +144,9 @@ log_lsn_current disabled
log_lsn_checkpoint_age disabled
log_lsn_buf_pool_oldest disabled
log_max_modified_age_async disabled
-log_pending_log_flushes disabled
-log_pending_checkpoint_writes disabled
-log_num_log_io disabled
log_waits disabled
log_write_requests disabled
log_writes disabled
-log_padded disabled
compress_pages_compressed disabled
compress_pages_decompressed disabled
compression_pad_increments disabled
@@ -282,9 +275,6 @@ os_data_fsyncs enabled
os_pending_reads enabled
os_pending_writes enabled
os_log_bytes_written disabled
-os_log_fsyncs disabled
-os_log_pending_fsyncs enabled
-os_log_pending_writes enabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/innodb/r/online_table_rebuild.result b/mysql-test/suite/innodb/r/online_table_rebuild.result
index d4bddbc5305..46d9780decb 100644
--- a/mysql-test/suite/innodb/r/online_table_rebuild.result
+++ b/mysql-test/suite/innodb/r/online_table_rebuild.result
@@ -43,5 +43,25 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
+#
+# MDEV-30183 Assertion `!memcmp(rec_trx_id, old_pk_trx_id->data,
+# 6 + 7)' failed in row_log_table_apply_update
+#
+set @old_sql_mode = @@sql_mode;
+set @@sql_mode="";
+CREATE TABLE t1(col_int int, col_varchar varchar(500))ENGINE=InnoDB;
+INSERT INTO t1(col_int) values(2560);
+set debug_sync="row_log_table_apply1_before SIGNAL con1_begin WAIT_FOR con1_commit";
+ALTER TABLE t1 ADD PRIMARY KEY ( col_varchar);
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_begin";
+UPDATE t1 SET col_int = 2178;
+INSERT INTO t1(col_int) VALUES(3016);
+UPDATE t1 set col_int=2802;
+SET DEBUG_SYNC="now SIGNAL con1_commit";
+connection default;
+ERROR 23000: Duplicate entry '' for key 'PRIMARY'
+DROP TABLE t1;
+SET @@sql_mode = @old_sql_mode;
disconnect con1;
SET DEBUG_SYNC=reset;
diff --git a/mysql-test/suite/innodb/r/rename_table.result b/mysql-test/suite/innodb/r/rename_table.result
index 8c3722c7940..0ed56005e21 100644
--- a/mysql-test/suite/innodb/r/rename_table.result
+++ b/mysql-test/suite/innodb/r/rename_table.result
@@ -21,7 +21,7 @@ path
DROP DATABASE abc_def;
# restart
DROP DATABASE abc_def2;
-call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)");
+call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
RENAME TABLE t1 TO non_existing_db.t1;
ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
diff --git a/mysql-test/suite/innodb/r/truncate_missing.result b/mysql-test/suite/innodb/r/truncate_missing.result
index b5348f65c5c..9e28d0fe556 100644
--- a/mysql-test/suite/innodb/r/truncate_missing.result
+++ b/mysql-test/suite/innodb/r/truncate_missing.result
@@ -1,5 +1,5 @@
call mtr.add_suppression("InnoDB: Operating system error number ");
-call mtr.add_suppression("InnoDB: (The error means|If you are|Cannot open datafile) ");
+call mtr.add_suppression("InnoDB: (Error number \\d+ means|If you are|Cannot open datafile) ");
call mtr.add_suppression("InnoDB: Ignoring tablespace for test/t ");
call mtr.add_suppression("InnoDB: Table test/t .* does not exist");
CREATE TABLE t (a SERIAL) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index a371a77971d..277d9b4e71b 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -15,11 +15,10 @@ call mtr.add_suppression("InnoDB: Operating system error.*in a file operation");
call mtr.add_suppression("InnoDB: \(The error means\|If you are\)");
call mtr.add_suppression("InnoDB: Ignoring tablespace `test/bug16720368` because it could not be opened");
call mtr.add_suppression("InnoDB: Tablespace .* was not found at.*bug16735660");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.");
call mtr.add_suppression("InnoDB: Plugin initialization aborted*");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
-call mtr.add_suppression("InnoDB: Table `test`\\.`bug16720368` is corrupted");
+call mtr.add_suppression("Table .*bug16720368.* is corrupted");
-- enable_query_log
-- echo #
@@ -79,7 +78,7 @@ EOF
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(*) FROM bug16720368;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
INSERT INTO bug16720368 VALUES(1);
INSERT INTO bug16720368_1 VALUES(1);
diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
index bac1b1dcdcf..9742adc30a6 100644
--- a/mysql-test/suite/innodb/t/alter_missing_tablespace.test
+++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
@@ -10,7 +10,7 @@
--disable_query_log
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: ");
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation");
-call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Ignoring tablespace for test/\(t\|x@002e@002ed\) because it could not be opened");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing");
call mtr.add_suppression("Could not find a valid tablespace file for");
diff --git a/mysql-test/suite/innodb/t/autoinc_persist.combinations b/mysql-test/suite/innodb/t/autoinc_persist.combinations
new file mode 100644
index 00000000000..4ae2948e523
--- /dev/null
+++ b/mysql-test/suite/innodb/t/autoinc_persist.combinations
@@ -0,0 +1,2 @@
+[asc]
+[desc]
diff --git a/mysql-test/suite/innodb/t/autoinc_persist.test b/mysql-test/suite/innodb/t/autoinc_persist.test
index a2832bd5187..ac933cc7b13 100644
--- a/mysql-test/suite/innodb/t/autoinc_persist.test
+++ b/mysql-test/suite/innodb/t/autoinc_persist.test
@@ -3,6 +3,19 @@
--source include/not_embedded.inc
--source include/no_valgrind_without_big.inc
+if ($MTR_COMBINATION_DESC) {
+ let $AUTO_INCREMENT_KEY_a= AUTO_INCREMENT, PRIMARY KEY(a DESC);
+ let $AUTO_INCREMENT_KEY_b= AUTO_INCREMENT, INDEX(b DESC);
+ let $AUTO_INCREMENT_PRIMARY_KEY_a= AUTO_INCREMENT, PRIMARY KEY(a DESC);
+ let $AUTO_INCREMENT_PRIMARY_KEY_b= AUTO_INCREMENT, ADD PRIMARY KEY(b DESC);
+}
+if (!$MTR_COMBINATION_DESC) {
+ let $AUTO_INCREMENT_KEY_a= AUTO_INCREMENT KEY;
+ let $AUTO_INCREMENT_KEY_b= AUTO_INCREMENT, KEY(b);
+ let $AUTO_INCREMENT_PRIMARY_KEY_a= AUTO_INCREMENT PRIMARY KEY;
+ let $AUTO_INCREMENT_PRIMARY_KEY_b= AUTO_INCREMENT PRIMARY KEY;
+}
+
--echo #
--echo # MDEV-6076 Persistent AUTO_INCREMENT for InnoDB
--echo #
@@ -21,72 +34,72 @@
SET SQL_MODE='STRICT_ALL_TABLES';
-CREATE TABLE t1(a TINYINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t1(a TINYINT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t1 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31);
SELECT * FROM t1;
-CREATE TABLE t2(a TINYINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t2(a TINYINT UNSIGNED $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t2 VALUES(-5);
INSERT INTO t2 VALUES(0), (0), (0), (0), (8), (10), (0),
(20), (30), (31);
SELECT * FROM t2;
-CREATE TABLE t3(a SMALLINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t3(a SMALLINT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t3 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31), (1024), (4096);
SELECT * FROM t3;
-CREATE TABLE t4(a SMALLINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t4(a SMALLINT UNSIGNED $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t4 VALUES(-5);
INSERT INTO t4 VALUES(0), (0), (0), (0), (8), (10), (0),
(20), (30), (31), (1024), (4096);
SELECT * FROM t4;
-CREATE TABLE t5(a MEDIUMINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t5(a MEDIUMINT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t5 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31), (1000000), (1000005);
SELECT * FROM t5;
-CREATE TABLE t6(a MEDIUMINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t6(a MEDIUMINT UNSIGNED $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t6 VALUES(-5);
INSERT INTO t6 VALUES(0), (0), (0), (0), (8), (10), (0),
(20), (30), (31), (1000000), (1000005);
SELECT * FROM t6;
-CREATE TABLE t7(a INT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t7(a INT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t7 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31), (100000000), (100000008);
SELECT * FROM t7;
-CREATE TABLE t8(a INT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t8(a INT UNSIGNED $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t8 VALUES(-5);
INSERT INTO t8 VALUES(0), (0), (0), (0), (8), (10), (0),
(20), (30), (31), (100000000), (100000008);
SELECT * FROM t8;
-CREATE TABLE t9(a BIGINT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t9(a BIGINT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t9 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31), (100000000000), (100000000006);
SELECT * FROM t9;
-CREATE TABLE t10(a BIGINT UNSIGNED AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t10(a BIGINT UNSIGNED $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t10 VALUES(-5);
INSERT INTO t10 VALUES(0), (0), (0), (0), (8), (10), (0),
(20), (30), (31), (100000000000), (100000000006);
SELECT * FROM t10;
-CREATE TABLE t11(a FLOAT AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t11(a FLOAT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t11 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31);
SELECT * FROM t11;
-CREATE TABLE t12(a DOUBLE AUTO_INCREMENT KEY) ENGINE = InnoDB;
+eval CREATE TABLE t12(a DOUBLE $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB;
INSERT INTO t12 VALUES(0), (0), (0), (0), (-1), (-10), (0),
(20), (30), (31);
SELECT * FROM t12;
@@ -106,7 +119,7 @@ SELECT MAX(a) AS `Expect 100000000` FROM t7;
DELETE FROM t9 WHERE a > 100000000000;
SELECT MAX(a) AS `Expect 100000000000` FROM t9;
-CREATE TABLE t13(a INT AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB,
+eval CREATE TABLE t13(a INT $AUTO_INCREMENT_KEY_a) ENGINE = InnoDB,
AUTO_INCREMENT = 1234;
--source include/restart_mysqld.inc
@@ -440,7 +453,7 @@ INSERT INTO t3 VALUES(0), (0), (200), (210);
--echo # Scenario 9: Test the sql_mode = NO_AUTO_VALUE_ON_ZERO
-CREATE TABLE t30 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT, key(b)) ENGINE = InnoDB;
+eval CREATE TABLE t30 (a INT NOT NULL $AUTO_INCREMENT_PRIMARY_KEY_a, b INT, key(b)) ENGINE = InnoDB;
set SQL_MODE = NO_AUTO_VALUE_ON_ZERO;
@@ -455,7 +468,7 @@ set global innodb_flush_log_at_trx_commit=1;
CREATE TABLE t31 (a INT) ENGINE = InnoDB;
INSERT INTO t31 VALUES(1), (2);
-ALTER TABLE t31 ADD b INT AUTO_INCREMENT PRIMARY KEY;
+eval ALTER TABLE t31 ADD b INT $AUTO_INCREMENT_PRIMARY_KEY_b;
INSERT INTO t31 VALUES(3, 0), (4, NULL), (5, NULL);
--error ER_DUP_ENTRY
INSERT INTO t31 VALUES(6, 0);
@@ -464,8 +477,7 @@ SELECT * FROM t31;
SET SQL_MODE = 0;
--echo # Scenario 10: Rollback would not rollback the counter
-CREATE TABLE t32 (
-a BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+eval CREATE TABLE t32 (a BIGINT $AUTO_INCREMENT_PRIMARY_KEY_a) ENGINE=InnoDB;
INSERT INTO t32 VALUES(0), (0);
@@ -481,10 +493,9 @@ ROLLBACK;
--echo # Scenario 11: Test duplicate primary key/secondary key will not stop
--echo # increasing the counter
-CREATE TABLE t33 (
+eval CREATE TABLE t33 (
a BIGINT NOT NULL PRIMARY KEY,
-b BIGINT NOT NULL AUTO_INCREMENT,
-KEY(b)) ENGINE = InnoDB;
+b BIGINT NOT NULL $AUTO_INCREMENT_KEY_b) ENGINE = InnoDB;
INSERT INTO t33 VALUES(1, NULL);
INSERT INTO t33 VALUES(2, NULL);
@@ -540,10 +551,9 @@ ib_backup_tablespaces("test", "t33");
EOF
UNLOCK TABLES;
DROP TABLE t33;
-CREATE TABLE t33 (
+eval CREATE TABLE t33 (
a BIGINT NOT NULL PRIMARY KEY,
-b BIGINT NOT NULL AUTO_INCREMENT,
-KEY(b)) ENGINE = InnoDB;
+b BIGINT NOT NULL $AUTO_INCREMENT_KEY_b) ENGINE = InnoDB;
ALTER TABLE t33 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
diff --git a/mysql-test/suite/innodb/t/compression_providers_loaded.combinations b/mysql-test/suite/innodb/t/compression_providers_loaded.combinations
new file mode 100644
index 00000000000..d2a413f3902
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_loaded.combinations
@@ -0,0 +1,19 @@
+[bzip2]
+innodb
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+innodb
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+innodb
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+innodb
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+innodb
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/innodb/t/compression_providers_loaded.test b/mysql-test/suite/innodb/t/compression_providers_loaded.test
new file mode 100644
index 00000000000..1b6c348ccfa
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_loaded.test
@@ -0,0 +1,18 @@
+let $alg = $MTR_COMBINATIONS;
+
+if (`SELECT COUNT(*) = 0 FROM information_schema.plugins WHERE plugin_name = "provider_$alg" AND plugin_status = "active"`)
+{
+ skip Needs provider_$alg plugin;
+}
+
+--echo #
+--echo # Testing unloaded compression provider: $alg
+--echo #
+
+--echo # Innodb_have_$alg reflects that the provider is loaded
+eval SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_$alg";
+
+--echo # Innodb_compression_algorithm can be set to $alg
+let $innodb_compression_algorithm_orig = `SELECT @@Innodb_compression_algorithm`;
+eval SET GLOBAL Innodb_compression_algorithm = $alg;
+eval SET GLOBAL Innodb_compression_algorithm = $innodb_compression_algorithm_orig;
diff --git a/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations b/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations
new file mode 100644
index 00000000000..20c49960390
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+innodb
+
+[lz4]
+innodb
+
+[lzma]
+innodb
+
+[lzo]
+innodb
+
+[snappy]
+innodb
diff --git a/mysql-test/suite/innodb/t/compression_providers_unloaded.test b/mysql-test/suite/innodb/t/compression_providers_unloaded.test
new file mode 100644
index 00000000000..84bcce59729
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_unloaded.test
@@ -0,0 +1,13 @@
+let $alg = $MTR_COMBINATIONS;
+
+--echo #
+--echo # Testing unloaded compression provider: $alg
+--echo #
+
+--echo # Innodb_have_$alg reflects that the provider is not loaded
+eval SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_$alg";
+
+--echo # Innodb_compression_algorithm cannot be set to $alg
+error ER_WRONG_VALUE_FOR_VAR;
+eval SET GLOBAL Innodb_compression_algorithm = $alg;
+show warnings;
diff --git a/mysql-test/suite/innodb/t/corrupted_during_recovery.test b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
index 31d353efa38..f383d9ab9b8 100644
--- a/mysql-test/suite/innodb/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
@@ -7,7 +7,7 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) corrupted page .*, page number=3\\]");
-call mtr.add_suppression("InnoDB: Table `test`.`t1` is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("Table test/t1 is corrupted. Please drop the table and recreate\\.");
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
call mtr.add_suppression("InnoDB: A long wait .* was observed for dict_sys");
--enable_query_log
@@ -59,7 +59,7 @@ SELECT * FROM t1;
let $restart_parameters=--innodb_force_recovery=1;
--source include/restart_mysqld.inc
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 60af7c9df80..78550763a9f 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -317,9 +317,9 @@ ALTER TABLE t1n CHANGE c2 c1 INT, CHANGE ct c2 INT, CHANGE c1 ct TEXT,
ALGORITHM=COPY;
SHOW CREATE TABLE t1n;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1n;
diff --git a/mysql-test/suite/innodb/t/innodb-index-online-fk.test b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
index 5c8954064ce..5423516c4b5 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
@@ -245,7 +245,7 @@ CREATE INDEX tb ON child(a2);
SET foreign_key_checks = 0;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE child CHANGE a2 a3 INT,
ADD CONSTRAINT fk_1 FOREIGN KEY (a2) REFERENCES parent(b)
ON DELETE SET NULL ON UPDATE CASCADE,
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.opt b/mysql-test/suite/innodb/t/innodb-index-online.opt
index ff20edbe2f7..1837463f07a 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.opt
+++ b/mysql-test/suite/innodb/t/innodb-index-online.opt
@@ -1,6 +1,5 @@
--loose-innodb-sort-buffer-size=64k
--loose-innodb-online-alter-log-max-size=128k
--loose-innodb-buffer-pool-size=5M
---loose-innodb-log-buffer-size=256k
--loose-innodb-sys-indexes
--loose-innodb-sys-fields
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 9350672bee9..c80e3e6c066 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1,7 +1,6 @@
-- source include/have_innodb.inc
# Embedded server tests do not support restarting.
-- source include/not_embedded.inc
--- source include/maybe_debug.inc
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -666,7 +665,7 @@ SET GLOBAL innodb_monitor_reset = module_ddl;
--echo # Skip sort
--echo # Change PK from (f1,f2,f5,f6) to (f1,f2,f5)
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f6;
--enable_info
alter table t1 drop column f6, drop primary key, add primary key(f1,f2,f5);
@@ -692,7 +691,7 @@ SET GLOBAL innodb_monitor_reset = module_ddl;
--echo # Must sort
--echo # Change PK from (f1,f2,f5) to (f1,f5)
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f2;
--enable_info
alter table t1 drop column f2, drop primary key, add primary key(f1,f5);
@@ -908,9 +907,9 @@ drop table t1;
create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f1, drop primary key;
# DROP PRIMARY KEY is implied for a single-column PRIMARY KEY
alter table t1 drop column f1, drop key f1;
@@ -1012,7 +1011,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o2,o3) by drop o1
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,2,2),(2,1,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o1, lock=none;
alter table t1 drop o1, drop primary key, add primary key(o2,o3), lock=none;
drop table t1;
@@ -1020,7 +1019,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o1,o3) by drop o2
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,1,2),(1,2,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o2, lock=none;
alter table t1 drop o2, drop primary key, add primary key(o1,o3), lock=none;
drop table t1;
@@ -1028,7 +1027,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o3) by drop o1,o2
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,2,2),(2,1,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o1, drop o2, lock=none;
alter table t1 drop o1, drop o2,drop primary key,add primary key(o3),lock=none;
drop table t1;
@@ -1126,9 +1125,6 @@ drop table t1;
--echo #
--source include/no_checkpoint_start.inc
-if ($have_debug) {
-SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus';
-}
CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB;
CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB;
@@ -1156,13 +1152,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd
--source include/start_mysqld.inc
-if ($have_debug) {
-# Initiate shutdown in order to issue a redo log checkpoint and to discard
-# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
---let $restart_noprint=2
---source include/restart_mysqld.inc
---let $restart_noprint=0
-}
SELECT * FROM t1;
SELECT * FROM t2;
@@ -1193,10 +1182,51 @@ SHOW CREATE TABLE t;
--disable_prepare_warnings
DROP TABLE t;
+--echo #
+--echo # MDEV-27374 InnoDB table becomes corrupt after renaming DESC-indexed column
+--echo #
+CREATE TABLE t1 (a VARCHAR(8), PRIMARY KEY(a DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 RENAME COLUMN a TO b, ALGORITHM=INPLACE;
+SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
+SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27432 ASC/DESC primary and unique keys cause index
+--echo # inconsistency between InnoDB and server
+--echo #
+CREATE TABLE t1 (id INT NOT NULL, UNIQUE(id DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD PRIMARY KEY (id), ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27445 Index inconsistency and assertion failure after
+--echo # renaming virtual column with DESC key
+--echo #
+CREATE TABLE t1(a INT, b INT AS (a), KEY(a, b DESC)) ENGINE=InnoDB;
+ALTER TABLE t1 RENAME COLUMN IF EXISTS b TO v;
+ALTER TABLE t1 FORCE;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27592 DESC primary index fails to set wide format
+--echo # while renaming the column
+--echo #
+CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(8), b INT, KEY(a DESC,b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'foo',10);
+ALTER TABLE t1 RENAME COLUMN b TO c, ALGORITHM=INPLACE;
+SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
+SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id ORDER BY INDEX_ID DESC LIMIT 1;
+SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
+DROP TABLE t1;
+
+--echo # End of 10.8 tests
+
--disable_query_log
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd.");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
diff --git a/mysql-test/suite/innodb/t/innodb-table-online-master.opt b/mysql-test/suite/innodb/t/innodb-table-online-master.opt
index 92eea2b0d2e..1eafb5ac188 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-table-online-master.opt
@@ -1 +1 @@
---innodb-sort-buffer-size=64k --innodb-online-alter-log-max-size=512k --innodb-buffer-pool-size=5M --innodb-log-buffer-size=256k
+--innodb-sort-buffer-size=64k --innodb-online-alter-log-max-size=512k --innodb-buffer-pool-size=5M
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index bfaabf24bd2..45b1bc1ec8e 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -313,7 +313,7 @@ SELECT
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
UPDATE t1 SET c3 = NULL WHERE c3 = '';
SET lock_wait_timeout = 1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5));
# NULL -> NOT NULL is only allowed INPLACE without IGNORE.
# Adding a PRIMARY KEY will add NOT NULL implicitly!
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index 76c7346b521..efa2b1ea403 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -19,7 +19,7 @@
let $restart_noprint=2;
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
-call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*");
call mtr.add_suppression("InnoDB: Ignoring tablespace .* because it could not be opened.");
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
diff --git a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
index 8f58bc6ce48..09c54db644f 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
@@ -528,9 +528,9 @@ ALGORITHM=COPY;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t1n;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/innodb_28867993.test b/mysql-test/suite/innodb/t/innodb_28867993.test
index 61e9578df7b..4777a9ac77f 100644
--- a/mysql-test/suite/innodb/t/innodb_28867993.test
+++ b/mysql-test/suite/innodb/t/innodb_28867993.test
@@ -6,6 +6,10 @@ source include/have_innodb.inc;
create table t1 (a int) engine=innodb;
insert t1 values (1),(2);
create database ib_logfile2;
+--disable_query_log
+call mtr.add_suppression("InnoDB: Operating system error number ");
+call mtr.add_suppression("InnoDB: Error number .* means ");
+--enable_query_log
source include/restart_mysqld.inc;
select * from t1;
drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
index 932829470e3..051f38a572e 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
@@ -7,7 +7,7 @@
let $wait_timeout = 180;
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+ SELECT SUBSTR(variable_value, 1, 30) = 'Completed resizing buffer pool'
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
@@ -45,7 +45,7 @@ SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
--enable_query_log
# Shrink buffer pool
-set global innodb_buffer_pool_size = 7340032;
+set global innodb_buffer_pool_size = 64 * 1024 * 1024 + 512 * 1024;
--source include/wait_condition.inc
select @@innodb_buffer_pool_size;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_temporary.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_temporary.test
index 1cdf4a318d0..c49ae451638 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_temporary.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_temporary.test
@@ -15,7 +15,7 @@ SET GLOBAL innodb_buffer_pool_size=8388608;
let $wait_timeout = 60;
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+ SELECT SUBSTR(variable_value, 1, 30) = 'Completed resizing buffer pool'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
index d11443ca1b2..78db6bf0d5a 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
@@ -8,7 +8,7 @@
let $wait_timeout = 180;
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+ SELECT SUBSTR(variable_value, 1, 30) = 'Completed resizing buffer pool'
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
diff --git a/mysql-test/suite/innodb/t/innodb_bug44571.test b/mysql-test/suite/innodb/t/innodb_bug44571.test
index e27ed0b9bf8..08f41ed8fd8 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44571.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44571.test
@@ -12,7 +12,7 @@ ALTER TABLE bug44571 CHANGE foo bar INT;
# because the CHANGE foo bar is successful. And
# the column name change would communicate to
# InnoDB with the fix from bug #47621
--- error ER_KEY_COLUMN_DOES_NOT_EXITS
+-- error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
# The following create indexes should succeed,
# indirectly confirm the CHANGE foo bar is successful.
diff --git a/mysql-test/suite/innodb/t/innodb_page_compressed.combinations b/mysql-test/suite/innodb/t/innodb_page_compressed.combinations
index f3caab14af3..498c85ee65c 100644
--- a/mysql-test/suite/innodb/t/innodb_page_compressed.combinations
+++ b/mysql-test/suite/innodb/t/innodb_page_compressed.combinations
@@ -1,6 +1,11 @@
[bzip2]
+plugin-load-add=$PROVIDER_BZIP2_SO
[lz4]
+plugin-load-add=$PROVIDER_LZ4_SO
[lzma]
+plugin-load-add=$PROVIDER_LZMA_SO
[lzo]
+plugin-load-add=$PROVIDER_LZO_SO
[snappy]
+plugin-load-add=$PROVIDER_SNAPPY_SO
[zlib]
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.opt b/mysql-test/suite/innodb/t/insert_into_empty.opt
new file mode 100644
index 00000000000..c856c2d215a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/insert_into_empty.opt
@@ -0,0 +1 @@
+--innodb_sort_buffer_size=65536
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index 010b7ecb43a..8452cecf700 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -210,7 +210,9 @@ INSERT INTO t1 SELECT * FROM seq_1_to_4096;
let $wait_condition= select n_rows > 100 from mysql.innodb_table_stats
where table_name="t1";
source include/wait_condition.inc;
-SELECT n_rows>=4096 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1";
+# At innodb_page_size=4k this will be only 4075, not 4096. Add some slack.
+# This is related to MDEV-24621 and possibly MDEV-26740.
+SELECT n_rows>=4000 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1";
DROP TABLE t1;
@@ -241,7 +243,7 @@ begin;
--error ER_WRONG_VALUE_COUNT_ON_ROW
INSERT INTO t VALUES (0,0);
SAVEPOINT a;
---error ER_DUP_ENTRY
+--error ER_ERROR_DURING_COMMIT
INSERT INTO t VALUES (0),(0);
SAVEPOINT a;
commit;
@@ -270,3 +272,210 @@ disconnect con1;
SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.6 tests
+
+--echo #
+--echo # MDEV-26947 UNIQUE column checks fail in InnoDB resulting
+--echo # in table corruption
+--echo #
+
+CREATE TABLE t (c1 INT KEY,c2 INT UNIQUE) ENGINE=InnoDB;
+BEGIN;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES (1,0),(2,0);
+CHECK TABLE t;
+COMMIT;
+DROP TABLE t;
+
+CREATE TABLE t (i INT UNIQUE)ENGINE=InnoDB;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES (0),(0);
+CHECK TABLE t;
+DROP TABLE t;
+
+CREATE TABLE t (c INT PRIMARY KEY,c2 CHAR(1) UNIQUE)ENGINE=InnoDB;
+BEGIN;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES(1, ''),(2, '');
+SELECT * FROM t;
+DELETE FROM t;
+COMMIT;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26956 LeakSanitizer/Valgrind errors in
+--echo # trx_mod_table_time_t::start_bulk_insert
+--echo # upon adding system versioning
+--echo #
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+ PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27316 Assertion `!(index)->is_spatial()' failed.
+--echo #
+CREATE TABLE t (c POINT NOT NULL, SPATIAL INDEX(c)) ENGINE=InnoDB;
+INSERT INTO t VALUES (POINT(1, 1));
+SELECT COUNT(*) FROM t WHERE MBRWithin(t.c, POINT(1,1));
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-27318 Assertion data_size < srv_sort_buf_size failed in row_merge_bulk_buf_add
+--echo #
+CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(REPEAT(1, 8459264));
+SELECT length(f1) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27858 Assertion `page_dir_get_n_heap(new_page) == 2U' failed in PageBulk::init
+--echo #
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+LOCK TABLES t1 WRITE,t2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_space
+--echo #
+CREATE TABLE t1(
+ f1 SERIAL,
+ f2 LINESTRING NOT NULL DEFAULT LineFromText('LINESTRING(1 1,2 2,3 3)'),
+SPATIAL INDEX(f2))ENGINE=InnoDB;
+--error ER_DUP_ENTRY
+INSERT INTO t1(f1) VALUES(0), (1), (2);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28237 Assertion `0' failed in row_upd_sec_index_entry on DELETE
+--echo #
+CREATE TABLE t1 (c0 YEAR UNIQUE) ENGINE=InnoDB;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(0),(0);
+DELETE FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28037 Assertion `trx->bulk_insert' failed in innodb_prepare_commit_versioned
+--echo #
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW UPDATE t2 SET c=1;
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-28242 Assertion `!check_foreigns' failed in
+--echo # trx_t::check_bulk_buffer
+--echo #
+CREATE TABLE t1 (c INT)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1), (1);
+SET SESSION foreign_key_checks=TRUE;
+SHOW CREATE TABLE t1;
+CREATE TABLE t2(d INT)ENGINE=InnoDB;
+DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
+--echo #
+
+SET SESSION foreign_key_checks=0;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1),(2);
+ALTER TABLE t1 REBUILD PARTITION p0;
+# Cleanup
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-29570 InnoDB fails to clean bulk buffer when server
+--echo # does rollback operation
+--echo #
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB
+ PARTITION BY RANGE (pk) (
+ PARTITION pn VALUES LESS THAN (20));
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+INSERT INTO t1 VALUES (1),(21);
+# Cleanup
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-29761 Bulk insert fails to rollback
+--echo # during insert..select
+--echo #
+CREATE TABLE t1 (f1 INT)ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INT, UNIQUE INDEX(f1)) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(1);
+BEGIN;
+INSERT t1 SELECT 1 FROM seq_1_to_2;
+COMMIT;
+SELECT * FROM t1;
+SELECT * FROM t2;
+CHECK TABLE t1;
+CHECK TABLE t2;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-29801 Inconsistent ER_TOO_BIG_ROWSIZE during bulk
+--echo # insert operation
+--echo #
+call mtr.add_suppression("InnoDB: Cannot add field `(c0[36]|c11)` in table");
+
+SET @format= @@innodb_default_row_format;
+CREATE TABLE t1 (pk int primary key, c01 text, c02 text, c03 text,
+ c04 text, c05 text, c06 text, c07 text, c08 text,
+ c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB;
+SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT;
+--replace_result 1982 8126 4030 8126
+ALTER TABLE t1 FORCE;
+INSERT IGNORE INTO t1 VALUES
+(1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)),
+(2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107));
+CHECK TABLE t1;
+DROP TABLE t1;
+SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format;
+
+--echo #
+--echo # MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file()
+--echo #
+
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL,
+ `data` LONGBLOB NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+ (1, REPEAT('X', @@innodb_sort_buffer_size)),
+ (2, REPEAT('X', @@innodb_sort_buffer_size));
+
+SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size);
+DROP TABLE t1;
+
+--echo # End of 10.7 tests
+
+--echo #
+--echo # MDEV-30426 Assertion !rec_offs_nth_extern(offsets2, n)
+--echo # during bulk insert
+--echo #
+CREATE TABLE t1(f1 TEXT NOT NULL, f2 TEXT NOT NULL,
+ f3 TEXT NOT NULL, f4 TEXT NOT NULL,
+ f5 TEXT NOT NULL, f6 TEXT NOT NULL,
+ PRIMARY KEY(f6(10)))ENGINE=InnoDB;
+BEGIN;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES
+ (repeat('a', 200), repeat('b', 200), repeat('c', 200),
+ repeat('d', 200), repeat('e', 200), repeat('f', 200)),
+ (repeat('b', 20000), repeat('c', 16000), repeat('d', 12000),
+ repeat('e', 12000), repeat('f', 12000), repeat('f', 12000));
+COMMIT;
+DROP TABLE t1;
+--echo # End of 10.8 tests
diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
index 87a36186150..3a811def170 100644
--- a/mysql-test/suite/innodb/t/instant_alter_import.test
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -4,7 +4,7 @@
call mtr.add_suppression("Operating system error number .* in a file operation.");
call mtr.add_suppression("The error means the system cannot find the path specified.");
-call mtr.add_suppression("File ./test/t1.ibd: 'delete' returned OS error");
+call mtr.add_suppression("File ./test/t1.ibd was not found");
--disable_query_log
call mtr.add_suppression("Table `test`.`t2` contains unrecognizable instant ALTER metadata");
diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test
index 333fefee507..6f7080f5b50 100644
--- a/mysql-test/suite/innodb/t/log_corruption.test
+++ b/mysql-test/suite/innodb/t/log_corruption.test
@@ -8,8 +8,8 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Unsupported redo log format");
-call mtr.add_suppression("InnoDB: No valid checkpoint found");
-call mtr.add_suppression("InnoDB: Invalid (log block|redo log header) checksum");
+call mtr.add_suppression("InnoDB: No valid checkpoint was found");
+call mtr.add_suppression("InnoDB: Invalid log header checksum");
call mtr.add_suppression("InnoDB: Missing MLOG_CHECKPOINT");
call mtr.add_suppression("InnoDB: MLOG_FILE_NAME incorrect");
call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND");
@@ -17,8 +17,7 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
-call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile0 to start up the database\\? Log sequence number in the ib_logfile0 is 1213964,");
-call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!");
+call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files (1048576|4194304) bytes!");
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
--enable_query_log
@@ -136,8 +135,6 @@ eval $check_no_innodb;
let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and we did not find a valid checkpoint;
--source include/search_pattern_in_file.inc
-let SEARCH_PATTERN=Plugin 'InnoDB' registration as a STORAGE ENGINE failed;
---source include/search_pattern_in_file.inc
--echo # redo log from before MariaDB 10.2.2, with corrupted log block
--remove_file $bugdir/ib_logfile0
@@ -156,7 +153,6 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and it appears corrupted;
--source include/search_pattern_in_file.inc
--echo # empty redo log from before MariaDB 10.2.2
@@ -167,7 +163,7 @@ die unless seek(OUT, 0x800, 0);
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 0, 0xb2a);
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@@ -197,7 +193,7 @@ print OUT chr(0) x 2048;
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@@ -206,7 +202,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and it appears corrupted;
--source include/search_pattern_in_file.inc
---echo # Empty multi-file redo log from before MariaDB 10.2.2
+--echo # Empty multi-file redo log (wrong offset) from before MariaDB 10.2.2
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile1";
binmode OUT;
@@ -216,13 +212,13 @@ print OUT chr(0) x 1536;
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN= InnoDB: Upgrading redo log:
+--let SEARCH_PATTERN= Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and we did not find a valid checkpoint\\.
--source include/search_pattern_in_file.inc
--echo # Multi-file redo log with size mismatch from after MariaDB 10.2.2
@@ -247,15 +243,14 @@ close OUT or die;
EOF
--echo # Corrupted multi-file redo log from after MariaDB 10.2.2
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN=InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!
--source include/search_pattern_in_file.inc
---let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported\\. The redo log was created with BogoDB 1\\.2\\.3\\.4, and it appears corrupted\\.
+--let SEARCH_PATTERN=InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\\.2\\.3\\.4\\.
--source include/search_pattern_in_file.inc
perl;
@@ -266,13 +261,15 @@ print OUT chr(0);
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported\\. The redo log was created with BogoDB 1\\.2\\.3\\.4, and it appears corrupted\\.
+--let SEARCH_PATTERN=InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 1048576 bytes!
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=InnoDB: No valid checkpoint was found; the log was created with BogoDB 1\\.2\\.3\\.4\\.
--source include/search_pattern_in_file.inc
--echo # Empty multi-file redo log from after MariaDB 10.2.2
@@ -288,13 +285,12 @@ print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
--let $restart_parameters= $dirs
@@ -311,7 +307,9 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: Invalid redo log header checksum;
+--let SEARCH_PATTERN=InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files 4194304 bytes!
+--source include/search_pattern_in_file.inc
+let SEARCH_PATTERN=InnoDB: Invalid log header checksum;
--source include/search_pattern_in_file.inc
--echo # distant future redo log format, with valid header checksum
@@ -347,7 +345,7 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: No valid checkpoint found .corrupted redo log;
+--let SEARCH_PATTERN=InnoDB: No valid checkpoint was found; the log was created with malicious intentions, or perhaps\\.
--source include/search_pattern_in_file.inc
--echo # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
@@ -358,6 +356,9 @@ die unless seek(OUT, 0x210, 0);
print OUT pack("NNx[264]", 0, 0x80c);
print OUT pack("NNx[212]N", 0x590dbaac, 0xfe922582, 0xc72d49c4);
close OUT or die;
+die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
+print OUT pack("x[4194304]");
+close OUT or die;
EOF
# Anything below innodb_force_recovery=6 must find a valid redo log.
# Missing tablespace files are tolerated already with innodb_force_recovery=1.
@@ -365,7 +366,7 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122;
+let SEARCH_PATTERN=InnoDB: Invalid log header checksum;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported\. The redo log was created with malicious intentions, or perhaps, and it appears corrupted\.;
--source include/search_pattern_in_file.inc
@@ -382,14 +383,14 @@ EOF
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122;
+let SEARCH_PATTERN=InnoDB: Invalid log header checksum;
--source include/search_pattern_in_file.inc
--echo # --innodb-force-recovery=6 (skip the entire redo log)
--let $restart_parameters= $dirs --innodb-force-recovery=6
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN=\\[Note\\] InnoDB: .* started; log sequence number 0
+--let SEARCH_PATTERN=\\[Note\\] InnoDB: log sequence number 0.*; transaction id 0
--source include/search_pattern_in_file.inc
--echo # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
@@ -466,7 +467,7 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151;
+let SEARCH_PATTERN=InnoDB: Invalid log header checksum
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=\\[ERROR\\] InnoDB: Upgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1, and it appears corrupted\.;
--source include/search_pattern_in_file.inc
@@ -540,13 +541,13 @@ print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
close OUT or die;
EOF
---let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
+--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN= InnoDB: .* started; log sequence number 1213964; transaction id 0
+--let SEARCH_PATTERN= InnoDB: log sequence number 1213964\\b.*; transaction id 0
--source include/search_pattern_in_file.inc
--echo # Empty 10.2 redo log
@@ -579,6 +580,33 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
+--echo # Empty 10.5 redo log
+perl;
+die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
+binmode OUT;
+# header block
+print OUT pack("Nx[5]nx[5]", 0x50485953, 0x1286);
+print OUT "ibbackup was here!!!1!";
+print OUT pack("x[470]N", 0x677700cf);
+# invalid (all-zero) checkpoint page 1 and an empty log page
+print OUT chr(0) x 1024;
+# valid checkpoint block 2
+print OUT pack("x[12]NNNx[264]", 0x12860c, 0, 0x80c);
+# pointer to the FILE_CHECKPOINT record, and checkpoint page checksum
+print OUT pack("H*x[204]NNN", "590DBAACFE922582", 0x128612, 0, 0x101741b);
+# log page
+print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
+close OUT or die;
+EOF
+
+--source include/start_mysqld.inc
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+--source include/shutdown_mysqld.inc
+--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
+--source include/search_pattern_in_file.inc
+
--echo # Minimal MariaDB 10.1.21 encrypted redo log
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
diff --git a/mysql-test/suite/innodb/t/log_file.test b/mysql-test/suite/innodb/t/log_file.test
index 2484e787973..438fbe1a6e1 100644
--- a/mysql-test/suite/innodb/t/log_file.test
+++ b/mysql-test/suite/innodb/t/log_file.test
@@ -12,7 +12,7 @@ call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Operating system error number \d+ in a file operation");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
-call mtr.add_suppression("InnoDB: File .path.to.non-existent.ib_logfile101: 'create' returned OS error \d+");
+call mtr.add_suppression("InnoDB: File /path/to/non-existent/ib_logfile101 was not found");
call mtr.add_suppression("InnoDB: Cannot create .path.to.non-existent.ib_logfile101");
call mtr.add_suppression("InnoDB: The data file '.*ibdata1' was not found but one of the other data files '.*ibdata2' exists");
call mtr.add_suppression("InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages");
@@ -62,7 +62,7 @@ let SEARCH_PATTERN=\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN=File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+;
+let SEARCH_PATTERN=Cannot create /path/to/non-existent/ib_logfile101;
--source include/search_pattern_in_file.inc
--list_files $bugdir
@@ -209,8 +209,6 @@ eval $check_no_innodb;
--source include/start_mysqld.inc
eval $check_yes_innodb;
--source include/shutdown_mysqld.inc
---let SEARCH_PATTERN=Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+
---source include/search_pattern_in_file.inc
--let $restart_parameters=
--source include/start_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index 89fe04bcdfb..eb616d7f835 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -146,13 +146,12 @@ DROP TABLE t0;
--disable_query_log
# The following are for the orphan file t0.ibd or for the directory t2.ibd:
call mtr.add_suppression("InnoDB: Operating system error number [0-9]* in a file operation");
-call mtr.add_suppression("InnoDB: Error number [0-9]* means '(File exists|Is a directory)'");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Cannot create file '.*t0.ibd'");
call mtr.add_suppression("InnoDB: The file '.*t0\.ibd' already exists");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-write: '.*t2\.ibd'");
# The following are for aborted startup without --innodb-force-recovery:
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*test");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Cannot read first page of '.*test.[tu]2.ibd': I/O error");
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=3\\] of corrupted file './test/t2\\.ibd'");
call mtr.add_suppression("InnoDB: Datafile '.*test.*ibd' is corrupted");
diff --git a/mysql-test/suite/innodb/t/log_file_name_debug.test b/mysql-test/suite/innodb/t/log_file_name_debug.test
deleted file mode 100644
index 9e3a7f8a83b..00000000000
--- a/mysql-test/suite/innodb/t/log_file_name_debug.test
+++ /dev/null
@@ -1,49 +0,0 @@
---source include/have_innodb.inc
-# Embedded server does not support restarting
---source include/not_embedded.inc
---source include/have_debug.inc
---source include/no_valgrind_without_big.inc
-
---echo #
---echo # Bug#19685095 DO NOT CARE ABOUT UNRESOLVED MLOG_FILE_NAME
---echo # IF THERE ARE NO OPERATIONS TO APPLY
---echo #
-
-SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus';
---disable_query_log
-call mtr.add_suppression("InnoDB: Plugin initialization aborted");
-call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
-call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
-FLUSH TABLES;
---enable_query_log
-
---let $change=`SELECT if(@@innodb_log_file_size = 4194304, 8388608, 4194304)`
---let $resize= --innodb-log-file-size=$change
-
---source include/no_checkpoint_start.inc
-
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
-
---let CLEANUP_IF_CHECKPOINT=DROP TABLE t1;
---source include/no_checkpoint_end.inc
-
---let $restart_parameters= --debug=d,innodb_log_abort_1 $resize
---source include/start_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
---let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
---let SEARCH_PATTERN = InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either
---source include/search_pattern_in_file.inc
-
---let $restart_parameters= --debug=d,innodb_log_abort_3 $resize
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
---let $restart_parameters=
---source include/restart_mysqld.inc
-# Initiate shutdown in order to issue a redo log checkpoint and to discard
-# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
---source include/restart_mysqld.inc
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test
index fc6cb1ef83e..261b024fa41 100644
--- a/mysql-test/suite/innodb/t/log_file_size.test
+++ b/mysql-test/suite/innodb/t/log_file_size.test
@@ -7,36 +7,55 @@
# This test is slow on buildbot.
--source include/big_test.inc
-if (`SELECT @@innodb_log_file_size = 1048576`) {
- --skip Test requires innodb_log_file_size>1M.
-}
-
--disable_query_log
-call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata file do not match the log sequence number [0-9]+ in the ib_logfile");
call mtr.add_suppression("syntax error in innodb_log_group_home_dir");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("InnoDB: innodb_read_only prevents crash recovery");
-call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile");
-call mtr.add_suppression("InnoDB: Cannot (create|resize) log file in read-only mode");
-call mtr.add_suppression("InnoDB: Can't initiate database recovery, running in read-only-mode");
-call mtr.add_suppression("InnoDB: Log file .*ib_logfile0.* size");
-call mtr.add_suppression("InnoDB: Unable to open .*ib_logfile0. to check native AIO read support");
+call mtr.add_suppression("InnoDB: Log file .*ib_logfile1.* size");
+call mtr.add_suppression("InnoDB: File .*ib_logfile0 (is too small|was not found)");
+call mtr.add_suppression("InnoDB: Expecting only ib_logfile0");
FLUSH TABLES;
--enable_query_log
let MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
--source include/shutdown_mysqld.inc
---move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile.old
-write_file $MYSQLD_DATADIR/ib_logfile0;
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
+my $file = "$ENV{MYSQLD_DATADIR}ib_logfile0";
+open(FILE, "<$file") || die "Unable to open $file\n";
+seek(FILE, 4096, 0) || die "Unable to seek $file\n";
+die unless read(FILE, $_, 8) == 8;
+my ($lsn_hi,$lsn_lo) = unpack("NN", $_);
+seek(FILE, 8192, 0) || die "Unable to seek $file\n";
+die unless read(FILE, $_, 8) == 8;
+my ($cp2hi,$cp2lo) = unpack("NN", $_);
+if ($cp2hi < $lsn_hi) {}
+elsif ($cp2hi > $lsn_hi || $cp2lo > $lsn_lo)
+{ $lsn_hi=$cp2hi;$lsn_lo=$cp2lo; }
+close(FILE);
+open(FILE, ">", $file) or die "Unable to open $file\n";
+binmode FILE;
+my $polynomial = 0x82f63b78; # CRC-32C
+my ($header, $checkpoint, $log);
+$header = "Phys" . pack("x[4]NN", $lsn_hi, $lsn_lo) .
+ "some Perl code" . pack("x[478]");
+$header .= pack("Nx[3584]", mycrc32($header, 0, $polynomial));
+$checkpoint = pack("NNNNx[44]", $lsn_hi, $lsn_lo, $lsn_hi, $lsn_lo);
+$checkpoint .= pack("Nx[8128]", mycrc32($checkpoint, 0, $polynomial));
+$log = pack("CxxNN", 0xfa, $lsn_hi, $lsn_lo);
+$log .= pack("CN", 1, mycrc32($log, 0, $polynomial));
+print FILE $header, $checkpoint, $log;
+close(FILE) or die "Unable to close $file\n";
EOF
+
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
---let $restart_parameters= --innodb-log-file-size=2m
+--let $restart_parameters= --innodb-log-file-size=4m
--source include/start_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
@@ -95,11 +114,6 @@ SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: Starting crash recovery from checkpoint LSN=.*;
--source include/search_pattern_in_file.inc
---let $restart_parameters= --debug=d,innodb_log_abort_3
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
--let $restart_parameters= --innodb-read-only
--source include/restart_mysqld.inc
@@ -108,18 +122,11 @@ SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
--source include/search_pattern_in_file.inc
---let $restart_parameters= --debug=d,innodb_log_abort_4
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
---source include/search_pattern_in_file.inc
-
--let $restart_parameters= --debug=d,innodb_log_abort_5
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
-let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
+let SEARCH_PATTERN= redo log from 5\\.000MiB to [0-9.]*[KMGT]iB;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --innodb-read-only
@@ -129,87 +136,40 @@ SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
--source include/search_pattern_in_file.inc
---let $restart_parameters= --debug=d,innodb_log_abort_6
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
---source include/search_pattern_in_file.inc
-
---let $restart_parameters= --debug=d,innodb_log_abort_7
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-# this aborts right after deleting all log files
-
---let $restart_parameters= --innodb-read-only
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-let SEARCH_PATTERN= InnoDB: Cannot create log file in read-only mode;
---source include/search_pattern_in_file.inc
-
---let $restart_parameters= --debug=d,innodb_log_abort_8
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
---source include/search_pattern_in_file.inc
-
---let $restart_parameters= --debug=d,innodb_log_abort_9
---source include/restart_mysqld.inc
---error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
---source include/search_pattern_in_file.inc
---source include/shutdown_mysqld.inc
-
-# We should have perfectly synced files here.
# Trigger an error in recovery.
-perl;
-die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile0");
-print FILE "garbage";
-close(FILE);
+--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
+--write_file $MYSQLD_DATADIR/ib_logfile0
+garbage
EOF
---source include/start_mysqld.inc
+--let $restart_parameters=
+--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
-let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of 512 bytes;
+let SEARCH_PATTERN= InnoDB: File .*ib_logfile0 is too small;
--source include/search_pattern_in_file.inc
---remove_file $MYSQLD_DATADIR/ib_logfile0
+--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile1
--move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0
-perl;
-die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile1");
-print FILE "junkfill" x 131072;
-close(FILE);
-EOF
-
--source include/restart_mysqld.inc
+--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
+let SEARCH_PATTERN= InnoDB: Expecting only ib_logfile0;
+--source include/search_pattern_in_file.inc
--remove_file $MYSQLD_DATADIR/ib_logfile1
--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
---let $restart_parameters= --debug=d,innodb_log_abort_10
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
-SELECT * FROM t1;
-
-let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
---source include/search_pattern_in_file.inc
-let SEARCH_PATTERN= InnoDB: Renaming log file .*ib_logfile101 to .*ib_logfile0;
+let SEARCH_PATTERN= InnoDB: File .*ib_logfile0 was not found;
--source include/search_pattern_in_file.inc
+--move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0
---let $restart_parameters=
--source include/restart_mysqld.inc
-
SELECT * FROM t1;
DROP TABLE t1;
+
+--let SEARCH_PATTERN= InnoDB: Resizing redo log from 5\\.000MiB to [0-9.]*[KMGT]iB; LSN=\\d+\\b
+--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/missing_tablespaces.test b/mysql-test/suite/innodb/t/missing_tablespaces.test
index 92f963a262d..7aeb0a26f30 100644
--- a/mysql-test/suite/innodb/t/missing_tablespaces.test
+++ b/mysql-test/suite/innodb/t/missing_tablespaces.test
@@ -26,7 +26,7 @@ let $restart_noprint=2;
--disable_query_log
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
-call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number \\d+ means");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only");
call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace .* because it could not be opened");
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/online_table_rebuild.test b/mysql-test/suite/innodb/t/online_table_rebuild.test
index 1d34738703c..02e9639eae2 100644
--- a/mysql-test/suite/innodb/t/online_table_rebuild.test
+++ b/mysql-test/suite/innodb/t/online_table_rebuild.test
@@ -59,5 +59,29 @@ connection default;
reap;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-30183 Assertion `!memcmp(rec_trx_id, old_pk_trx_id->data,
+--echo # 6 + 7)' failed in row_log_table_apply_update
+--echo #
+set @old_sql_mode = @@sql_mode;
+set @@sql_mode="";
+CREATE TABLE t1(col_int int, col_varchar varchar(500))ENGINE=InnoDB;
+INSERT INTO t1(col_int) values(2560);
+set debug_sync="row_log_table_apply1_before SIGNAL con1_begin WAIT_FOR con1_commit";
+send ALTER TABLE t1 ADD PRIMARY KEY ( col_varchar);
+
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_begin";
+UPDATE t1 SET col_int = 2178;
+INSERT INTO t1(col_int) VALUES(3016);
+UPDATE t1 set col_int=2802;
+SET DEBUG_SYNC="now SIGNAL con1_commit";
+
+connection default;
+--error ER_DUP_ENTRY
+reap;
+DROP TABLE t1;
+SET @@sql_mode = @old_sql_mode;
disconnect con1;
SET DEBUG_SYNC=reset;
diff --git a/mysql-test/suite/innodb/t/rename_table.test b/mysql-test/suite/innodb/t/rename_table.test
index 35421f0ce7a..654f8809b22 100644
--- a/mysql-test/suite/innodb/t/rename_table.test
+++ b/mysql-test/suite/innodb/t/rename_table.test
@@ -32,7 +32,7 @@ DROP DATABASE abc_def;
DROP DATABASE abc_def2;
-call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)");
+call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
--replace_result "\\" "/"
diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test
index 4835cc997a8..5be076c6198 100644
--- a/mysql-test/suite/innodb/t/restart.test
+++ b/mysql-test/suite/innodb/t/restart.test
@@ -96,7 +96,7 @@ DROP TABLE tr,tc,td;
let $wait_timeout = 180;
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+ SELECT SUBSTR(variable_value, 1, 30) = 'Completed resizing buffer pool'
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
diff --git a/mysql-test/suite/innodb/t/truncate_missing.test b/mysql-test/suite/innodb/t/truncate_missing.test
index fb6bd678237..d36a2de5cd9 100644
--- a/mysql-test/suite/innodb/t/truncate_missing.test
+++ b/mysql-test/suite/innodb/t/truncate_missing.test
@@ -2,7 +2,7 @@
--source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Operating system error number ");
-call mtr.add_suppression("InnoDB: (The error means|If you are|Cannot open datafile) ");
+call mtr.add_suppression("InnoDB: (Error number \\d+ means|If you are|Cannot open datafile) ");
call mtr.add_suppression("InnoDB: Ignoring tablespace for test/t ");
call mtr.add_suppression("InnoDB: Table test/t .* does not exist");
diff --git a/mysql-test/suite/innodb_fts/r/create.result b/mysql-test/suite/innodb_fts/r/create.result
index 3ca24f5253d..4334344a981 100644
--- a/mysql-test/suite/innodb_fts/r/create.result
+++ b/mysql-test/suite/innodb_fts/r/create.result
@@ -187,4 +187,27 @@ FTS_DOC_ID bigint unsigned not null,
unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1),
fulltext (f2))
engine=innodb;
-ERROR 42000: Incorrect index name 'FTS_DOC_ID_INDEX'
+ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
+#
+# MDEV-26938 Support descending indexes internally in InnoDB
+#
+CREATE TABLE t1(a INT PRIMARY KEY, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+UNIQUE KEY FTS_DOC_ID_INDEX(FTS_DOC_ID DESC), FULLTEXT(b))
+ENGINE=InnoDB;
+ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
+CREATE TABLE t1(a INT PRIMARY KEY, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+UNIQUE KEY FTS_DOC_ID_INDEX(FTS_DOC_ID DESC)) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` text DEFAULT NULL,
+ `FTS_DOC_ID` bigint(20) unsigned NOT NULL,
+ PRIMARY KEY (`a`),
+ UNIQUE KEY `FTS_DOC_ID_INDEX` (`FTS_DOC_ID` DESC)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ALTER TABLE t1 ADD FULLTEXT INDEX(b), ALGORITHM=INPLACE;
+ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
+ALTER TABLE t1 ADD FULLTEXT INDEX(b), ALGORITHM=COPY;
+ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/r/versioning.result b/mysql-test/suite/innodb_fts/r/versioning.result
index 27e23c9b2d5..baf25331d0d 100644
--- a/mysql-test/suite/innodb_fts/r/versioning.result
+++ b/mysql-test/suite/innodb_fts/r/versioning.result
@@ -1,4 +1,5 @@
# Upgrade test
+DROP TABLE mysql.innodb_table_stats, mysql.innodb_index_stats;
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
ERROR HY000: Index articles is corrupted
@@ -291,8 +292,6 @@ drop index idx on articles2;
Warnings:
Warning 1082 InnoDB: Table test/articles2 contains 3 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB
create fulltext index idx on articles2(title, body);
-Warnings:
-Warning 1088 Error updating stats for table 'articles2' after table rebuild: Persistent statistics do not exist
SELECT * FROM articles2 WHERE MATCH (title,body)
AGAINST ('the' IN NATURAL LANGUAGE MODE);
id title body
diff --git a/mysql-test/suite/innodb_fts/t/create.test b/mysql-test/suite/innodb_fts/t/create.test
index 710fd9cb99b..e6a7e993f84 100644
--- a/mysql-test/suite/innodb_fts/t/create.test
+++ b/mysql-test/suite/innodb_fts/t/create.test
@@ -111,10 +111,28 @@ SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save;
--echo #
--echo # MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields
--echo #
---error ER_WRONG_NAME_FOR_INDEX
+--error ER_INNODB_FT_WRONG_DOCID_INDEX
create table t1 (
f1 int, f2 text,
FTS_DOC_ID bigint unsigned not null,
unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1),
fulltext (f2))
engine=innodb;
+
+--echo #
+--echo # MDEV-26938 Support descending indexes internally in InnoDB
+--echo #
+
+--error ER_INNODB_FT_WRONG_DOCID_INDEX
+CREATE TABLE t1(a INT PRIMARY KEY, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+ UNIQUE KEY FTS_DOC_ID_INDEX(FTS_DOC_ID DESC), FULLTEXT(b))
+ENGINE=InnoDB;
+
+CREATE TABLE t1(a INT PRIMARY KEY, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+ UNIQUE KEY FTS_DOC_ID_INDEX(FTS_DOC_ID DESC)) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+--error ER_INNODB_FT_WRONG_DOCID_INDEX
+ALTER TABLE t1 ADD FULLTEXT INDEX(b), ALGORITHM=INPLACE;
+--error ER_INNODB_FT_WRONG_DOCID_INDEX
+ALTER TABLE t1 ADD FULLTEXT INDEX(b), ALGORITHM=COPY;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/versioning.combinations b/mysql-test/suite/innodb_fts/t/versioning.combinations
deleted file mode 100644
index 42842ba51a6..00000000000
--- a/mysql-test/suite/innodb_fts/t/versioning.combinations
+++ /dev/null
@@ -1,2 +0,0 @@
-[prepare]
-[upgrade]
diff --git a/mysql-test/suite/innodb_fts/t/versioning.opt b/mysql-test/suite/innodb_fts/t/versioning.opt
deleted file mode 100644
index df323743314..00000000000
--- a/mysql-test/suite/innodb_fts/t/versioning.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---innodb-file-per-table=0
---innodb-doublewrite=0
diff --git a/mysql-test/suite/innodb_fts/t/versioning.test b/mysql-test/suite/innodb_fts/t/versioning.test
deleted file mode 100644
index 286597fba39..00000000000
--- a/mysql-test/suite/innodb_fts/t/versioning.test
+++ /dev/null
@@ -1,131 +0,0 @@
---source include/have_innodb.inc
---source include/have_gzip.inc
---source include/not_embedded.inc
-
-# Combinations
-#
-# upgrade: test upgrade on prepared databases from std_data.
-# prepare: requires $OLD_BINDIR, test upgrade and downgrade with old-version
-# server. Also prepare std_data files during the run in the source
-# directory (you just have to commit or reject them).
-#
-# Examples
-#
-# export OLD_BINDIR="/home/midenok/src/mariadb/10.3b/build"
-# ./mtr innodb_fts.versioning,prepare
-#
-
-if ($MTR_COMBINATION_PREPARE)
-{
- if (!$OLD_BINDIR)
- {
- --skip Requires OLD_BINDIR parameter (see test comment)
- }
-}
-
---let $server_id= `select @@server_id`
---let $datadir= `select @@datadir`
---let $std_dir= $MYSQL_TEST_DIR/std_data/versioning
---let $restart_noprint= 3
-
---echo # Upgrade test
-let $stopword_table= articles2;
-
-if ($MTR_COMBINATION_PREPARE)
-{
- let $restart_bindir= $OLD_BINDIR;
- --source include/restart_mysqld.inc
-
- let $create_options= with system versioning;
- let $basic_stage= create_table;
- --source basic.inc
- let $basic_stage= insert_1;
- --source basic.inc
- let $basic_stage= insert_2;
- --source basic.inc
- let $basic_stage= insert_3;
- --source basic.inc
- let $stopword_stage= create_table;
- --source stopword.inc
- eval insert into $stopword_table (title, body)
- values ('test for stopwords','this is it...');
- insert into user_stopword values("the");
- delete from user_stopword;
- insert into user_stopword values("this");
- --source include/shutdown_mysqld.inc
-
- --exec mkdir -p $std_dir
- --exec cp -af $datadir/ibdata1 $datadir/test/*.frm $std_dir
- # zero out the doublewrite buffer
- --exec dd if=/dev/zero of=$std_dir/ibdata1 bs=16k seek=64 count=128 conv=notrunc
- --exec gzip -9f $std_dir/ibdata1 $std_dir/*.frm
-}
-
-if ($MTR_COMBINATION_UPGRADE)
-{
---disable_query_log
-call mtr.add_suppression("InnoDB: Table `mysql`.\`innodb_(table|index)_stats`");
---enable_query_log
- --source include/shutdown_mysqld.inc
- --exec rm -f $datadir/test/*.ibd $datadir/ib*
- --exec cp -af $std_dir/ibdata1.gz $datadir
- --exec cp -af $std_dir/*.frm.gz $datadir/test
- --exec gzip -df $datadir/ibdata1.gz $datadir/test/*.frm.gz
-}
-let $restart_bindir=;
---source include/start_mysqld.inc
-
---error ER_INDEX_CORRUPT
-SELECT * FROM articles WHERE MATCH (title,body)
-AGAINST ('Database' IN NATURAL LANGUAGE MODE);
-
-call mtr.add_suppression("test/articles.? contains 3 indexes inside InnoDB");
-alter table articles force;
-flush tables;
-show create table articles;
-
-let $basic_stage= select_1;
-source basic.inc;
-let $basic_stage= select_2;
-source basic.inc;
-let $basic_stage= select_3;
-source basic.inc;
-
-set global innodb_ft_server_stopword_table= "test/user_stopword";
-let $stopword_stage= select_1;
---source stopword.inc
-eval drop index idx on $stopword_table;
-eval create fulltext index idx on $stopword_table(title, body);
---source stopword.inc
-
-if ($MTR_COMBINATION_PREPARE)
-{
- --echo # Downgrade test
- let $restart_bindir= $OLD_BINDIR;
- --source include/restart_mysqld.inc
-
- alter table articles force;
- flush tables;
- show create table articles;
- let $basic_stage= select_1;
- source basic.inc;
- let $basic_stage= select_2;
- source basic.inc;
- let $basic_stage= select_3;
- source basic.inc;
-
- set global innodb_ft_server_stopword_table= "test/user_stopword";
- let $stopword_stage= select_1;
- # Downgrade faults with assertion "dict_index_get_n_unique(index) == 1"
- # until we rebuilt the index:
- eval drop index idx on $stopword_table;
- eval create fulltext index idx on $stopword_table(title, body);
- source stopword.inc;
-
- let $restart_bindir=;
- --source include/restart_mysqld.inc
-}
-
---echo # Cleanup
-eval drop tables articles, $stopword_table, user_stopword;
-set global innodb_ft_server_stopword_table= default;
diff --git a/mysql-test/suite/innodb_gis/r/0.result b/mysql-test/suite/innodb_gis/r/0.result
index c9864fad830..f05c7db24bd 100644
--- a/mysql-test/suite/innodb_gis/r/0.result
+++ b/mysql-test/suite/innodb_gis/r/0.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result
index b40c24b8fc6..35711a63a8a 100644
--- a/mysql-test/suite/innodb_gis/r/1.result
+++ b/mysql-test/suite/innodb_gis/r/1.result
@@ -660,9 +660,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index 08632b67514..5365e7d0f8c 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -779,7 +779,7 @@ SET timestamp=default;
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
alter table t1 add column i int;
-ERROR 22007: Incorrect POINT value: 'LINESTRING(0 0,1 1)' for column `test`.`t1`.`p` at row 1
+ERROR 22007: Incorrect POINT value: 'LINESTRING(0 0,1 1)' for column `test`.`t1`.`p` at row 0
drop table t1;
SET timestamp=default;
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb_gis/r/geometry.result b/mysql-test/suite/innodb_gis/r/geometry.result
index e5acdf5eb6f..c38e9e28d85 100644
--- a/mysql-test/suite/innodb_gis/r/geometry.result
+++ b/mysql-test/suite/innodb_gis/r/geometry.result
@@ -342,7 +342,7 @@ tab CREATE TABLE `tab` (
`c7` geometrycollection DEFAULT NULL,
`c8` geometry DEFAULT NULL,
UNIQUE KEY `idx2` (`c8`(5)),
- KEY `idx1` (`c2`(5)) USING BTREE,
+ KEY `idx1` (`c2`(5) DESC) USING BTREE,
KEY `idx3` (`c3`(5)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
#check the data after modify
@@ -778,7 +778,7 @@ tab3 CREATE TABLE `tab3` (
`c7` geometrycollection DEFAULT NULL,
`c8` geometry DEFAULT NULL,
UNIQUE KEY `idx2` (`c8`(5)),
- KEY `idx1` (`c2`(5)) USING BTREE,
+ KEY `idx1` (`c2`(5) DESC) USING BTREE,
KEY `idx3` (`c3`(5)) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=16
#check index with WKB function
diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result
index 36711c39050..ca37674b05f 100644
--- a/mysql-test/suite/innodb_gis/r/gis.result
+++ b/mysql-test/suite/innodb_gis/r/gis.result
@@ -661,9 +661,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb_gis/t/1.test b/mysql-test/suite/innodb_gis/t/1.test
index 950db360794..99651842795 100644
--- a/mysql-test/suite/innodb_gis/t/1.test
+++ b/mysql-test/suite/innodb_gis/t/1.test
@@ -387,9 +387,9 @@ t1 where object_id=85984;
drop table t1;
create table t1 (fl geometry not null);
---error 1416
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
insert into t1 values (1);
---error 1416
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
insert into t1 values (1.11);
--error 1416
insert into t1 values ("qwerty");
diff --git a/mysql-test/suite/innodb_gis/t/gis.test b/mysql-test/suite/innodb_gis/t/gis.test
index 966aea7bc77..b27e1852d6e 100644
--- a/mysql-test/suite/innodb_gis/t/gis.test
+++ b/mysql-test/suite/innodb_gis/t/gis.test
@@ -380,9 +380,9 @@ t1 where object_id=85984;
drop table t1;
create table t1 (fl geometry not null);
---error 1416
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
insert into t1 values (1);
---error 1416
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
insert into t1 values (1.11);
--error 1416
insert into t1 values ("qwerty");
diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
index dadf1117f7e..62a28a981cd 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
@@ -5,7 +5,7 @@ call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
call mtr.add_suppression("InnoDB: Unknown index id .* on page");
call mtr.add_suppression("InnoDB: Operating system error number");
-call mtr.add_suppression("InnoDB: The error means");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Cannot open datafile .*t1\\.ibd");
call mtr.add_suppression("InnoDB: Ignoring tablespace for test/t1 ");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
diff --git a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
index c30a4f8f000..36dcd1e454b 100644
--- a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
+++ b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
@@ -21,7 +21,7 @@ call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
call mtr.add_suppression("InnoDB: Unknown index id .* on page");
call mtr.add_suppression("InnoDB: Operating system error number");
-call mtr.add_suppression("InnoDB: The error means");
+call mtr.add_suppression("InnoDB: Error number \\d+ means");
call mtr.add_suppression("InnoDB: Cannot open datafile .*t1\\.ibd");
call mtr.add_suppression("InnoDB: Ignoring tablespace for test/t1 ");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
diff --git a/mysql-test/suite/json/r/json_no_table.result b/mysql-test/suite/json/r/json_no_table.result
index 6784fe6da32..10dd5d4b4ca 100644
--- a/mysql-test/suite/json/r/json_no_table.result
+++ b/mysql-test/suite/json/r/json_no_table.result
@@ -3338,7 +3338,7 @@ OBJECT
CREATE VIEW v1 AS SELECT JSON_TYPE(JSON_OBJECT());
SELECT * FROM v1;
JSON_TYPE(JSON_OBJECT())
-OBJE
+OBJECT
drop view v1;
#
# Bug#21198333 SIG 6 IN ITEM_CACHE_JSON::CACHE_VALUE AT SQL/ITEM.CC:9470
diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result
index b9cc09fdd97..b71cc95a4e3 100644
--- a/mysql-test/suite/json/r/json_table.result
+++ b/mysql-test/suite/json/r/json_table.result
@@ -211,13 +211,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
- "table": {
- "table_name": "tt",
- "access_type": "ALL",
- "rows": 40,
- "filtered": 100,
- "table_function": "json_table"
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "tt",
+ "access_type": "ALL",
+ "rows": 40,
+ "filtered": 100,
+ "table_function": "json_table"
+ }
+ }
+ ]
}
}
explain select * from
diff --git a/mysql-test/suite/json/r/json_table_mysql.result b/mysql-test/suite/json/r/json_table_mysql.result
index 699d5a8b4f3..2357d9d3cf0 100644
--- a/mysql-test/suite/json/r/json_table_mysql.result
+++ b/mysql-test/suite/json/r/json_table_mysql.result
@@ -189,13 +189,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
- "table": {
- "table_name": "tt",
- "access_type": "ALL",
- "rows": 40,
- "filtered": 100,
- "table_function": "json_table"
- }
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "tt",
+ "access_type": "ALL",
+ "rows": 40,
+ "filtered": 100,
+ "table_function": "json_table"
+ }
+ }
+ ]
}
}
select * from
diff --git a/mysql-test/suite/json/r/type_json.result b/mysql-test/suite/json/r/type_json.result
index b9b70f24190..333e933eda9 100644
--- a/mysql-test/suite/json/r/type_json.result
+++ b/mysql-test/suite/json/r/type_json.result
@@ -113,7 +113,7 @@ def COALESCE(c0, c6) 254 30 1 Y 0 39 8
COALESCE(c0, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c0, c7) 254 30 1 Y 0 39 8
+def COALESCE(c0, c7) 253 30 1 Y 0 39 8
COALESCE(c0, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -305,11 +305,11 @@ def COALESCE(c6, c6) 3 11 1 Y 32896 0 63
COALESCE(c6, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c6, c7) 254 11 1 Y 0 39 8
+def COALESCE(c6, c7) 253 11 1 Y 0 39 8
COALESCE(c6, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c0) 254 30 1 Y 0 39 8
+def COALESCE(c7, c0) 253 30 1 Y 0 39 8
COALESCE(c7, c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -333,11 +333,11 @@ def COALESCE(c7, c5) 251 4294967295 1 Y 0 39 8
COALESCE(c7, c5)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c6) 254 11 1 Y 0 39 8
+def COALESCE(c7, c6) 253 11 1 Y 0 39 8
COALESCE(c7, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c7) 254 1 1 Y 0 39 8
+def COALESCE(c7, c7) 253 1 1 Y 0 39 8
COALESCE(c7, c7)
1
CALL p1('t1', 'LEAST(colt1, colt2)');
@@ -370,7 +370,7 @@ def LEAST(c0, c6) 5 23 1 Y 32896 31 63
LEAST(c0, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c0, c7) 254 30 1 Y 0 39 8
+def LEAST(c0, c7) 253 30 1 Y 0 39 8
LEAST(c0, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -566,7 +566,7 @@ def LEAST(c6, c7) 5 17 1 Y 32896 0 63
LEAST(c6, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c7, c0) 254 30 1 Y 0 39 8
+def LEAST(c7, c0) 253 30 1 Y 0 39 8
LEAST(c7, c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -594,7 +594,7 @@ def LEAST(c7, c6) 5 17 1 Y 32896 0 63
LEAST(c7, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c7, c7) 254 1 1 Y 0 39 8
+def LEAST(c7, c7) 253 1 1 Y 0 39 8
LEAST(c7, c7)
1
CALL p1('t1', 'colt1+colt2');
@@ -884,7 +884,7 @@ def COALESCE(c0, c6) 254 30 1 Y 0 39 8
COALESCE(c0, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c0, c7) 254 30 1 Y 0 39 8
+def COALESCE(c0, c7) 253 30 1 Y 0 39 8
COALESCE(c0, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1076,11 +1076,11 @@ def COALESCE(c6, c6) 3 11 1 Y 32896 0 63
COALESCE(c6, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c6, c7) 254 11 1 Y 0 39 8
+def COALESCE(c6, c7) 253 11 1 Y 0 39 8
COALESCE(c6, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c0) 254 30 1 Y 0 39 8
+def COALESCE(c7, c0) 253 30 1 Y 0 39 8
COALESCE(c7, c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1104,11 +1104,11 @@ def COALESCE(c7, c5) 251 4294967295 1 Y 0 39 8
COALESCE(c7, c5)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c6) 254 11 1 Y 0 39 8
+def COALESCE(c7, c6) 253 11 1 Y 0 39 8
COALESCE(c7, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(c7, c7) 254 1 1 Y 0 39 8
+def COALESCE(c7, c7) 253 1 1 Y 0 39 8
COALESCE(c7, c7)
1
CALL p1('t1c', 'LEAST(colt1, colt2)');
@@ -1141,7 +1141,7 @@ def LEAST(c0, c6) 5 23 1 Y 32896 31 63
LEAST(c0, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c0, c7) 254 30 1 Y 0 39 8
+def LEAST(c0, c7) 253 30 1 Y 0 39 8
LEAST(c0, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1337,7 +1337,7 @@ def LEAST(c6, c7) 5 17 1 Y 32896 0 63
LEAST(c6, c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c7, c0) 254 30 1 Y 0 39 8
+def LEAST(c7, c0) 253 30 1 Y 0 39 8
LEAST(c7, c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1365,7 +1365,7 @@ def LEAST(c7, c6) 5 17 1 Y 32896 0 63
LEAST(c7, c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(c7, c7) 254 1 1 Y 0 39 8
+def LEAST(c7, c7) 253 1 1 Y 0 39 8
LEAST(c7, c7)
1
CALL p1('t1c', 'colt1+colt2');
@@ -1675,7 +1675,7 @@ def COALESCE(t1.c0, t2.c11) 254 30 1 Y 0 39 8
COALESCE(t1.c0, t2.c11)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c0, t2.c12) 254 30 1 Y 0 39 8
+def COALESCE(t1.c0, t2.c12) 253 30 1 Y 0 39 8
COALESCE(t1.c0, t2.c12)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1987,11 +1987,11 @@ def COALESCE(t1.c6, t2.c11) 253 19 1 Y 0 39 8
COALESCE(t1.c6, t2.c11)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c6, t2.c12) 254 11 1 Y 0 39 8
+def COALESCE(t1.c6, t2.c12) 253 11 1 Y 0 39 8
COALESCE(t1.c6, t2.c12)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c0) 254 30 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c0) 253 30 1 Y 0 39 8
COALESCE(t1.c7, t2.c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -2015,31 +2015,31 @@ def COALESCE(t1.c7, t2.c5) 251 4294967295 1 Y 0 39 8
COALESCE(t1.c7, t2.c5)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c6) 254 11 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c6) 253 11 1 Y 0 39 8
COALESCE(t1.c7, t2.c6)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c7) 254 22 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c7) 253 22 1 Y 0 39 8
COALESCE(t1.c7, t2.c7)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c8) 254 12 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c8) 253 12 1 Y 0 39 8
COALESCE(t1.c7, t2.c8)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c9) 254 10 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c9) 253 10 1 Y 0 39 8
COALESCE(t1.c7, t2.c9)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c10) 254 10 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c10) 253 10 1 Y 0 39 8
COALESCE(t1.c7, t2.c10)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c11) 254 19 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c11) 253 19 1 Y 0 39 8
COALESCE(t1.c7, t2.c11)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COALESCE(t1.c7, t2.c12) 254 1 1 Y 0 39 8
+def COALESCE(t1.c7, t2.c12) 253 1 1 Y 0 39 8
COALESCE(t1.c7, t2.c12)
1
CALL p2('LEAST(t1.colt1, t2.colt2)');
@@ -2092,7 +2092,7 @@ def LEAST(t1.c0, t2.c11) 12 26 26 Y 128 6 63
LEAST(t1.c0, t2.c11)
0000-00-00 00:00:00.000000
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(t1.c0, t2.c12) 254 30 1 Y 0 39 8
+def LEAST(t1.c0, t2.c12) 253 30 1 Y 0 39 8
LEAST(t1.c0, t2.c12)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -2408,7 +2408,7 @@ def LEAST(t1.c6, t2.c12) 5 17 1 Y 32896 0 63
LEAST(t1.c6, t2.c12)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(t1.c7, t2.c0) 254 30 1 Y 0 39 8
+def LEAST(t1.c7, t2.c0) 253 30 1 Y 0 39 8
LEAST(t1.c7, t2.c0)
1
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -2456,7 +2456,7 @@ def LEAST(t1.c7, t2.c11) 12 19 19 Y 128 0 63
LEAST(t1.c7, t2.c11)
0000-00-00 00:00:00
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def LEAST(t1.c7, t2.c12) 254 1 1 Y 0 39 8
+def LEAST(t1.c7, t2.c12) 253 1 1 Y 0 39 8
LEAST(t1.c7, t2.c12)
1
CALL p2('t1.colt1+t2.colt2');
diff --git a/mysql-test/suite/maria/maria2.result b/mysql-test/suite/maria/maria2.result
index b4b27512054..c25659ae1f8 100644
--- a/mysql-test/suite/maria/maria2.result
+++ b/mysql-test/suite/maria/maria2.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2;
CREATE TABLE t1 (
line BLOB,
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
@@ -68,3 +67,99 @@ pk apk data
3 4 NULL
5 6 NULL
drop table t1;
+#
+# End of 5.5 tests
+#
+#
+# MDEV-27303 Table corruption after insert into a non-InnoDB table with DESC index
+#
+create table t1 (
+a bigint default 0,
+b bigint default 0,
+c binary(128) not null,
+d datetime default '0000-00-00 00:00:00',
+key (c desc,b,d,a)
+) engine=aria;
+insert into t1 (c) values
+('xx'),('bb'),('tt'),('pp'),('mm'),('yy'),('rr'),('bb'),('yy'),('gg'),
+('dd'),('fx'),('wi'),('ix'),('ox'),('mu'),('ux'),('pm'),('mx'),('xu'),
+('ul'),('lp'),('px'),('lp'),('xx'),('pq'),('qs'),('se'),('ee'),('xx'),
+('rv'),('ff'),('vj'),('jy'),('yn'),('nc'),('nx'),('hj'),('ji'),('ik'),
+('kk'),('ww'),('xx'),('yd'),('dw'),('wk'),('kr'),('dd'),('rj'),('jf'),
+('bx'),('fc'),('cp'),('pm'),('mw'),('wy'),('yl'),('li'),('ic'),('he'),
+('ci'),('il'),('lz'),('zd'),('gz'),('xd'),('ze'),('dm'),('ms'),('xd'),
+('sw'),('we'),('nb'),('tx'),('vr'),('xw'),('aa'),('ah'),('hd'),('jl'),
+('lf'),('fw'),('wx'),('xh'),('hr'),('zx'),('vw'),('rm'),('mx'),('xt'),
+('tp'),('ps'),('sh'),('ga'),('df'),('as'),('gz'),('xd'),('yy'),('xr');
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+#
+# MDEV-27309 Server crash or ASAN memcpy-param-overlap upon INSERT into Aria/MyISAM table with DESC key
+#
+CREATE TABLE t1 (id INT, c BINARY(80), PRIMARY KEY(id));
+ALTER TABLE t1 ADD KEY(c DESC, id);
+INSERT INTO t1 VALUES (1,NULL),(2,''),(3,'');
+DROP TABLE t1;
+#
+# MDEV-27330 Wrong sorting order with DESC index and empty strings in MyISAM/Aria table
+#
+create table t (id int, c char(128) not null, key (c desc)) engine=aria;
+insert into t values (1,''),(2,'foo'),(3,''),(4,'bar');
+select c from t order by c;
+c
+
+
+bar
+foo
+drop table t;
+#
+# MDEV-27340 NULL gets lost (becomes empty string), SELECT hangs with DESC index on MyISAM/Aria table
+#
+create table t (c char(8), key(c desc)) engine=aria character set utf8mb4;
+insert into t values (''),('foo'),(null),(''),('bar');
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+check table t extended;
+Table Op Msg_type Msg_text
+test.t check status OK
+select distinct c from t;
+c
+NULL
+
+bar
+foo
+select c from t;
+c
+foo
+bar
+
+
+NULL
+drop table t;
+#
+# MDEV-27434 DESC attribute does not work with auto-increment on secondary column of multi-part index
+#
+create table t (a int auto_increment, b int, unique(b,a desc)) engine=aria;
+insert ignore into t (b) values (10),(10),(10);
+select * from t;
+a b
+3 10
+2 10
+1 10
+drop table t;
+#
+# MDEV-27585 Auto-increment on secondary column increments unexpectedly with DESC key
+#
+create table t (c char(16), i int auto_increment, index (c,i desc)) engine=aria collate latin1_swedish_ci;
+insert into t (c) values ('ä'),('a');
+select hex(c),c,i from t order by c, i;
+hex(c) c i
+61 a 1
+C3A4 ä 1
+drop table t;
+#
+# End of 10.8 tests
+#
diff --git a/mysql-test/suite/maria/maria2.test b/mysql-test/suite/maria/maria2.test
index df691569e05..0f4a50ad99d 100644
--- a/mysql-test/suite/maria/maria2.test
+++ b/mysql-test/suite/maria/maria2.test
@@ -1,10 +1,5 @@
--source include/have_maria.inc
-# Initialise
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
# Test for BUG#36319
# "Aria: table is not empty but DELETE and SELECT find no rows"
@@ -109,3 +104,78 @@ select * from t1 order by pk;
load data infile '../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
select * from t1 order by pk;
drop table t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-27303 Table corruption after insert into a non-InnoDB table with DESC index
+--echo #
+create table t1 (
+ a bigint default 0,
+ b bigint default 0,
+ c binary(128) not null,
+ d datetime default '0000-00-00 00:00:00',
+ key (c desc,b,d,a)
+) engine=aria;
+insert into t1 (c) values
+ ('xx'),('bb'),('tt'),('pp'),('mm'),('yy'),('rr'),('bb'),('yy'),('gg'),
+ ('dd'),('fx'),('wi'),('ix'),('ox'),('mu'),('ux'),('pm'),('mx'),('xu'),
+ ('ul'),('lp'),('px'),('lp'),('xx'),('pq'),('qs'),('se'),('ee'),('xx'),
+ ('rv'),('ff'),('vj'),('jy'),('yn'),('nc'),('nx'),('hj'),('ji'),('ik'),
+ ('kk'),('ww'),('xx'),('yd'),('dw'),('wk'),('kr'),('dd'),('rj'),('jf'),
+ ('bx'),('fc'),('cp'),('pm'),('mw'),('wy'),('yl'),('li'),('ic'),('he'),
+ ('ci'),('il'),('lz'),('zd'),('gz'),('xd'),('ze'),('dm'),('ms'),('xd'),
+ ('sw'),('we'),('nb'),('tx'),('vr'),('xw'),('aa'),('ah'),('hd'),('jl'),
+ ('lf'),('fw'),('wx'),('xh'),('hr'),('zx'),('vw'),('rm'),('mx'),('xt'),
+ ('tp'),('ps'),('sh'),('ga'),('df'),('as'),('gz'),('xd'),('yy'),('xr');
+check table t1 extended;
+drop table t1;
+
+--echo #
+--echo # MDEV-27309 Server crash or ASAN memcpy-param-overlap upon INSERT into Aria/MyISAM table with DESC key
+--echo #
+CREATE TABLE t1 (id INT, c BINARY(80), PRIMARY KEY(id));
+ALTER TABLE t1 ADD KEY(c DESC, id);
+INSERT INTO t1 VALUES (1,NULL),(2,''),(3,'');
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27330 Wrong sorting order with DESC index and empty strings in MyISAM/Aria table
+--echo #
+create table t (id int, c char(128) not null, key (c desc)) engine=aria;
+insert into t values (1,''),(2,'foo'),(3,''),(4,'bar');
+select c from t order by c;
+drop table t;
+
+--echo #
+--echo # MDEV-27340 NULL gets lost (becomes empty string), SELECT hangs with DESC index on MyISAM/Aria table
+--echo #
+create table t (c char(8), key(c desc)) engine=aria character set utf8mb4;
+insert into t values (''),('foo'),(null),(''),('bar');
+check table t;
+check table t extended;
+select distinct c from t;
+select c from t;
+drop table t;
+
+--echo #
+--echo # MDEV-27434 DESC attribute does not work with auto-increment on secondary column of multi-part index
+--echo #
+create table t (a int auto_increment, b int, unique(b,a desc)) engine=aria;
+insert ignore into t (b) values (10),(10),(10);
+select * from t;
+drop table t;
+
+--echo #
+--echo # MDEV-27585 Auto-increment on secondary column increments unexpectedly with DESC key
+--echo #
+create table t (c char(16), i int auto_increment, index (c,i desc)) engine=aria collate latin1_swedish_ci;
+insert into t (c) values ('ä'),('a');
+select hex(c),c,i from t order by c, i;
+drop table t;
+
+--echo #
+--echo # End of 10.8 tests
+--echo #
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff
new file mode 100644
index 00000000000..2202a51119e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lz4 compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lz4;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff
new file mode 100644
index 00000000000..e6b52d3ac07
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzma compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzma;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff
new file mode 100644
index 00000000000..75e9519d680
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzo compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzo;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff
new file mode 100644
index 00000000000..da281efffc4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with snappy compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = snappy;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.combinations b/mysql-test/suite/mariabackup/compression_providers_loaded.combinations
new file mode 100644
index 00000000000..3287917fd5e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.result b/mysql-test/suite/mariabackup/compression_providers_loaded.result
new file mode 100644
index 00000000000..6cd928b02f7
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.result
@@ -0,0 +1,27 @@
+#
+# Testing mariabackup with bzip2 compression
+#
+# Creating table
+set global innodb_compression_algorithm = bzip2;
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# restart
+# xtrabackup backup
+# xtrabackup prepare;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.test b/mysql-test/suite/mariabackup/compression_providers_loaded.test
new file mode 100644
index 00000000000..aad21ff01a4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.test
@@ -0,0 +1,38 @@
+let $alg = $MTR_COMBINATIONS;
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip "Needs provider_$alg plugin";
+}
+
+--echo #
+--echo # Testing mariabackup with $alg compression
+--echo #
+
+--echo # Creating table
+eval set global innodb_compression_algorithm = $alg;
+eval create table t1 (a int, b text $column_params) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+--source include/restart_mysqld.inc
+
+--echo # xtrabackup backup
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+disable_result_log;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+enable_result_log;
+
+--echo # xtrabackup prepare;
+disable_result_log;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+source include/restart_and_restore.inc;
+enable_result_log;
+
+select a, left(b, 9), length(b) from t1;
+
+drop table t1;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff
new file mode 100644
index 00000000000..4b874403830
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lz4 compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lz4 compression
++set global innodb_compression_algorithm = lz4;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff
new file mode 100644
index 00000000000..ff57834f624
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzma compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lzma compression
++set global innodb_compression_algorithm = lzma;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzma
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff
new file mode 100644
index 00000000000..5308fc4333e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzo compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lzo compression
++set global innodb_compression_algorithm = lzo;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzo
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff
new file mode 100644
index 00000000000..b7b5e2b51c2
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with snappy compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with snappy compression
++set global innodb_compression_algorithm = snappy;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-snappy
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations b/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations
new file mode 100644
index 00000000000..3287917fd5e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.result b/mysql-test/suite/mariabackup/compression_providers_unloaded.result
new file mode 100644
index 00000000000..ccf3e0355a4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.result
@@ -0,0 +1,22 @@
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Refusing to load corrupted table");
+#
+# Testing mariabackup with bzip2 compression
+#
+# Create table with bzip2 compression
+set global innodb_compression_algorithm = bzip2;
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# Restart server without plugin
+call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+# restart: --disable-provider-bzip2
+# xtrabackup backup
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.test b/mysql-test/suite/mariabackup/compression_providers_unloaded.test
new file mode 100644
index 00000000000..673c16d03cf
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.test
@@ -0,0 +1,35 @@
+let $alg = $MTR_COMBINATIONS;
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Refusing to load corrupted table");
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip "Needs provider_$alg plugin";
+}
+
+--echo #
+--echo # Testing mariabackup with $alg compression
+--echo #
+
+--echo # Create table with $alg compression
+eval set global innodb_compression_algorithm = $alg;
+eval create table t1 (a int, b text $column_params) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+--echo # Restart server without plugin
+call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+let $restart_parameters = --disable-provider-$alg;
+source include/restart_mysqld.inc;
+
+--echo # xtrabackup backup
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+error 1;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+
+drop table t1;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/huge_lsn,strict_crc32.rdiff b/mysql-test/suite/mariabackup/huge_lsn,strict_crc32.rdiff
new file mode 100644
index 00000000000..29afd468751
--- /dev/null
+++ b/mysql-test/suite/mariabackup/huge_lsn,strict_crc32.rdiff
@@ -0,0 +1,11 @@
+@@ -1,8 +1,8 @@
+ #
+ # MDEV-13416 mariabackup fails with EFAULT "Bad Address"
+ #
+-# restart: --innodb-log-file-size=4M --innodb-encrypt-log=0
+-FOUND 1 /InnoDB: log sequence number 17596481011216/ in mysqld.1.err
++# restart
++FOUND 1 /redo log: [0-9.]*[KMGT]iB; LSN=17596481010687\b/ in mysqld.1.err
+ CREATE TABLE t(i INT) ENGINE=INNODB ENCRYPTED=YES;
+ INSERT INTO t VALUES(1);
+ # xtrabackup backup
diff --git a/mysql-test/suite/mariabackup/huge_lsn.result b/mysql-test/suite/mariabackup/huge_lsn.result
index 73b51ea438f..503d13fcac4 100644
--- a/mysql-test/suite/mariabackup/huge_lsn.result
+++ b/mysql-test/suite/mariabackup/huge_lsn.result
@@ -1,8 +1,8 @@
#
# MDEV-13416 mariabackup fails with EFAULT "Bad Address"
#
-# restart
-FOUND 1 /InnoDB: New log file created, LSN=175964\d{8}/ in mysqld.1.err
+# restart: --innodb-log-file-size=4M --innodb-encrypt-log=0
+FOUND 1 /InnoDB: log sequence number 17596481011216/ in mysqld.1.err
CREATE TABLE t(i INT) ENGINE=INNODB ENCRYPTED=YES;
INSERT INTO t VALUES(1);
# xtrabackup backup
diff --git a/mysql-test/suite/mariabackup/huge_lsn.test b/mysql-test/suite/mariabackup/huge_lsn.test
index 66fe00dd761..8850e9d8954 100644
--- a/mysql-test/suite/mariabackup/huge_lsn.test
+++ b/mysql-test/suite/mariabackup/huge_lsn.test
@@ -14,8 +14,8 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=
--enable_result_log
--source include/shutdown_mysqld.inc
+if ($MTR_COMBINATION_STRICT_CRC32) {
perl;
-do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
my $file= "$ENV{MYSQLD_DATADIR}/ibdata1";
open(FILE, "+<", $file) or die "Unable to open $file\n";
binmode FILE;
@@ -23,23 +23,54 @@ my $ps= $ENV{INNODB_PAGE_SIZE};
my $page;
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
substr($page,26,8) = pack("NN", 4096, ~1024);
-my $polynomial = 0x82f63b78; # CRC-32C
-my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
-if ($full_crc32)
-{
- my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
- substr($page, $ps-4, 4) = pack("N", $ck);
-}
sysseek(FILE, 0, 0) || die "Unable to rewind $file\n";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file\n";
+
+$file= "$ENV{MYSQLD_DATADIR}/ib_logfile0";
+open(FILE, ">", $file) || die "Unable to truncate $file\n";
+close(FILE) || "Unable to close $file\n";
EOF
+--let SEARCH_PATTERN= redo log: [0-9.]*[KMGT]iB; LSN=17596481010687\\b
+}
---remove_files_wildcard $MYSQLD_DATADIR ib_logfile*
+if (!$MTR_COMBINATION_STRICT_CRC32) {
+perl;
+do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
+my $file= "$ENV{MYSQLD_DATADIR}/ib_logfile0";
+open(FILE, ">", $file) or die "Unable to open $file\n";
+binmode FILE;
+my $extra_repeat = 139820;
+# The desired log sequence number is 17596481011216 (0x1000fffffe10).
+my $file_size=4<<20;
+my $lsn_hi=4096,$lsn_lo=0xfffffe00 - $extra_repeat * 15;
+my $polynomial = 0x82f63b78; # CRC-32C
+my ($header, $checkpoint, $log);
+$header = "Phys" . pack("x[4]NN", $lsn_hi, $lsn_lo - $file_size + 0x300f) .
+ "some Perl code" . pack("x[478]");
+$header .= pack("Nx[3584]", mycrc32($header, 0, $polynomial));
+$checkpoint = pack("NNNNx[44]", $lsn_hi, $lsn_lo, $lsn_hi, $lsn_lo);
+$checkpoint .= pack("Nx[8128]", mycrc32($checkpoint, 0, $polynomial));
+$log = pack("CxxNN", 0xfa, $lsn_hi, $lsn_lo);
+$log .= pack("CN", 0, mycrc32($log, 0, $polynomial));
+
+# Write more than 2MiB of FILE_MODIFY mini-transactions to exercise the parser.
+my $extra = pack("CCxa*", 0xb9, 127, "a/b.ibd");
+$extra .= pack("CN", 0, mycrc32($extra, 0, $polynomial));
+
+print FILE $header, $checkpoint, $extra x ($extra_repeat - 1), $log;
+seek(FILE, $file_size - 15, 0);
+$extra = pack("CCxa*", 0xb9, 127, "c/d.ibd");
+$extra .= pack("CN", 1, mycrc32($extra, 0, $polynomial));
+print FILE $extra;
+close(FILE) or die "Unable to close $file\n";
+EOF
+--let SEARCH_PATTERN= InnoDB: log sequence number 17596481011216
+--let $restart_parameters=--innodb-log-file-size=4M --innodb-encrypt-log=0
+}
--source include/start_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
---let SEARCH_PATTERN= InnoDB: New log file created, LSN=175964\d{8}
--source include/search_pattern_in_file.inc
CREATE TABLE t(i INT) ENGINE=INNODB ENCRYPTED=YES;
@@ -55,6 +86,7 @@ INSERT INTO t VALUES(2);
echo # xtrabackup prepare;
--disable_result_log
exec $XTRABACKUP --prepare --target-dir=$targetdir;
+--let $restart_parameters=
--source include/restart_and_restore.inc
--enable_result_log
SELECT * FROM t;
diff --git a/mysql-test/suite/mariabackup/incremental_page_compressed.result b/mysql-test/suite/mariabackup/incremental_page_compressed.result
new file mode 100644
index 00000000000..eb059cdc769
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_page_compressed.result
@@ -0,0 +1,13 @@
+#
+# MDEV-26794 MariaBackup does not recognize added providers upon prepare of incremental backup
+#
+CREATE TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1),(2);
+INSTALL SONAME 'provider_snappy';
+SET GLOBAL innodb_compression_algorithm= snappy;
+CREATE TABLE t_snappy (a INT) ENGINE=InnoDB page_compressed=1;
+INSERT INTO t_snappy VALUES (3),(4);
+# restart: --innodb_buffer_pool_load_at_startup=0
+# Prepare initial backup
+# Prepare incremental backup
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/incremental_page_compressed.test b/mysql-test/suite/mariabackup/incremental_page_compressed.test
new file mode 100644
index 00000000000..f6ec26cfb46
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_page_compressed.test
@@ -0,0 +1,38 @@
+--echo #
+--echo # MDEV-26794 MariaBackup does not recognize added providers upon prepare of incremental backup
+--echo #
+
+if (!$PROVIDER_SNAPPY_SO) {
+ skip "Needs provider_snappy plugin";
+}
+
+--source include/have_innodb.inc
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+--let $incdir=$MYSQLTEST_VARDIR/tmp/inc
+
+CREATE TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1),(2);
+
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir
+
+INSTALL SONAME 'provider_snappy';
+
+SET GLOBAL innodb_compression_algorithm= snappy;
+
+CREATE TABLE t_snappy (a INT) ENGINE=InnoDB page_compressed=1;
+INSERT INTO t_snappy VALUES (3),(4);
+
+# disable buffer pool load to avoid MDEV-26794 warnings
+--let $restart_parameters= --innodb_buffer_pool_load_at_startup=0
+--source include/restart_mysqld.inc
+
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --incremental-basedir=$targetdir --target-dir=$incdir
+
+--echo # Prepare initial backup
+--exec $XTRABACKUP --prepare --target-dir=$targetdir
+
+--echo # Prepare incremental backup
+--exec $XTRABACKUP --prepare --target-dir=$targetdir --incremental-dir=$incdir > $MYSQLTEST_VARDIR/prepare.log 2>&1
+
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt
index 95b88d038ee..a0b4b588279 100644
--- a/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt
+++ b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt
@@ -1 +1 @@
---loose-innodb-log-file-size=2097152
+--loose-innodb-log-file-size=4194304
diff --git a/mysql-test/suite/mariabackup/innodb_redo_overwrite.opt b/mysql-test/suite/mariabackup/innodb_redo_overwrite.opt
index 19c08c8c945..a0b4b588279 100644
--- a/mysql-test/suite/mariabackup/innodb_redo_overwrite.opt
+++ b/mysql-test/suite/mariabackup/innodb_redo_overwrite.opt
@@ -1 +1 @@
---loose-innodb-log-file-size=2m
+--loose-innodb-log-file-size=4194304
diff --git a/mysql-test/suite/mariabackup/innodb_redo_overwrite.result b/mysql-test/suite/mariabackup/innodb_redo_overwrite.result
index 9076dbaa57a..bab5d4331e0 100644
--- a/mysql-test/suite/mariabackup/innodb_redo_overwrite.result
+++ b/mysql-test/suite/mariabackup/innodb_redo_overwrite.result
@@ -1,27 +1,5 @@
-CREATE TABLE t(i INT) ENGINE=INNODB;
-INSERT INTO t VALUES
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
-# Generate enough data to overwrite innodb redo log
-# on the next "INSERT INTO t SELECT * FROM t" execution.
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
-INSERT INTO t SELECT * FROM t;
+CREATE TABLE t ENGINE=INNODB SELECT seq%10 i FROM seq_0_to_204796;
# xtrabackup backup
-FOUND 1 /failed: redo log block is overwritten/ in backup.log
-FOUND 1 /failed: redo log block checksum does not match/ in backup.log
+FOUND 1 /Was only able to copy log from \d+ to \d+, not \d+; try increasing innodb_log_file_size\b/ in backup.log
+NOT FOUND /failed: redo log block checksum does not match/ in backup.log
DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/innodb_redo_overwrite.test b/mysql-test/suite/mariabackup/innodb_redo_overwrite.test
index 1ed75607be8..ab5993d232c 100644
--- a/mysql-test/suite/mariabackup/innodb_redo_overwrite.test
+++ b/mysql-test/suite/mariabackup/innodb_redo_overwrite.test
@@ -1,27 +1,10 @@
--source include/have_innodb.inc
--source include/have_debug_sync.inc
+--source include/have_debug.inc
+--source include/have_sequence.inc
--source include/no_valgrind_without_big.inc
-CREATE TABLE t(i INT) ENGINE=INNODB;
-
-INSERT INTO t VALUES
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
- (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
---echo # Generate enough data to overwrite innodb redo log
---echo # on the next "INSERT INTO t SELECT * FROM t" execution.
---let $i = 0
-while ($i < 9) {
-INSERT INTO t SELECT * FROM t;
---inc $i
-}
+CREATE TABLE t ENGINE=INNODB SELECT seq%10 i FROM seq_0_to_204796;
--echo # xtrabackup backup
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
@@ -34,13 +17,13 @@ INSERT INTO t SELECT * FROM t;
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events > $backuplog
--enable_result_log
---let SEARCH_PATTERN=failed: redo log block is overwritten
+--let SEARCH_PATTERN=Was only able to copy log from \\d+ to \\d+, not \\d+; try increasing innodb_log_file_size\\b
--let SEARCH_FILE=$backuplog
--source include/search_pattern_in_file.inc
--remove_file $backuplog
--rmdir $targetdir
---let before_innodb_log_copy_thread_started=INSERT INTO test.t VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9)
+--let before_innodb_log_copy_thread_started=INSERT INTO test.t SELECT seq FROM seq_0_to_9
--disable_result_log
--error 1
diff --git a/mysql-test/suite/mariabackup/missing_ibd.test b/mysql-test/suite/mariabackup/missing_ibd.test
index dc1406039e7..f406a555b4a 100644
--- a/mysql-test/suite/mariabackup/missing_ibd.test
+++ b/mysql-test/suite/mariabackup/missing_ibd.test
@@ -9,7 +9,7 @@ let MYSQLD_DATADIR=`select @@datadir`;
--disable_query_log
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: '.*test.t1\.ibd'");
-call mtr.add_suppression('InnoDB: Operating system error number');
+call mtr.add_suppression('InnoDB: (Operating system error number|Error number \\d+ means)');
call mtr.add_suppression('InnoDB: The error means the system cannot find the path specified\.');
call mtr.add_suppression('InnoDB: Table test/t1 in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist');
call mtr.add_suppression('InnoDB: Ignoring tablespace for test/t1 because it could not be opened\.');
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.result b/mysql-test/suite/mariabackup/xb_file_key_management.result
index 6cedfd2213b..cf8edb310b8 100644
--- a/mysql-test/suite/mariabackup/xb_file_key_management.result
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.result
@@ -1,5 +1,7 @@
-CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+CREATE TABLE t(c TEXT) ENGINE INNODB encrypted=yes;
+INSERT INTO t VALUES(REPEAT('fubar',100));
INSERT INTO t VALUES('foobar1');
+DELETE FROM t LIMIT 1;
# xtrabackup backup
NOT FOUND /foobar1/ in ib_logfile0
# expect NOT FOUND
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.test b/mysql-test/suite/mariabackup/xb_file_key_management.test
index 2a176952053..4d27b2dfa95 100644
--- a/mysql-test/suite/mariabackup/xb_file_key_management.test
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.test
@@ -1,8 +1,10 @@
#--source include/innodb_page_size.inc
--source include/have_file_key_management.inc
-CREATE TABLE t(c VARCHAR(10)) ENGINE INNODB encrypted=yes;
+CREATE TABLE t(c TEXT) ENGINE INNODB encrypted=yes;
+INSERT INTO t VALUES(REPEAT('fubar',100));
INSERT INTO t VALUES('foobar1');
+DELETE FROM t LIMIT 1;
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log
@@ -24,7 +26,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
--enable_result_log
--list_files $targetdir ib_logfile*
---cat_file $targetdir/ib_logfile0
+--remove_file $targetdir/ib_logfile0
SELECT * FROM t;
DROP TABLE t;
diff --git a/mysql-test/suite/multi_source/change_master.result b/mysql-test/suite/multi_source/change_master.result
new file mode 100644
index 00000000000..9fd84e51364
--- /dev/null
+++ b/mysql-test/suite/multi_source/change_master.result
@@ -0,0 +1,8 @@
+RESET MASTER;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+change master 'abc1' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master 'abc1' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+disconnect slave;
+connection default;
diff --git a/mysql-test/suite/multi_source/change_master.test b/mysql-test/suite/multi_source/change_master.test
new file mode 100644
index 00000000000..08e6909694f
--- /dev/null
+++ b/mysql-test/suite/multi_source/change_master.test
@@ -0,0 +1,13 @@
+--source include/not_embedded.inc
+
+RESET MASTER;
+
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+--error ER_RELAY_LOG_INIT
+change master 'abc1' to relay_log_file='';
+--error ER_RELAY_LOG_INIT
+change master 'abc1' to relay_log_file='';
+--disconnect slave
+--connection default
+
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.result b/mysql-test/suite/multi_source/multisource_for_channel.result
new file mode 100644
index 00000000000..cb1224b416f
--- /dev/null
+++ b/mysql-test/suite/multi_source/multisource_for_channel.result
@@ -0,0 +1,370 @@
+RESET MASTER;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+change master to relay_log_file='' for channel 'abc1';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master to master_host='' for channel 'abc2';
+ERROR HY000: Incorrect arguments to MASTER_HOST
+change master to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+start slave for channel 'master1';
+set default_master_connection = 'master1';
+include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection slave;
+#
+# Checking SHOW SLAVE 'master1' STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW SLAVE STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+#
+connection master1;
+drop database if exists db1;
+create database db1;
+use db1;
+create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
+insert into t1 (f1) values ('one'),('two');
+connection slave;
+select * from db1.t1;
+i f1
+1 one
+2 two
+# List of relay log files in the datadir
+mysqld-relay-bin-master1.000001
+mysqld-relay-bin-master1.000002
+mysqld-relay-bin-master1.index
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
+mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000002 # Gtid_list # # []
+mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # drop database if exists db1
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # create database db1
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
+mysqld-relay-bin-master1.000002 # Gtid # # BEGIN GTID #-#-#
+mysqld-relay-bin-master1.000002 # Intvar # # INSERT_ID=1
+mysqld-relay-bin-master1.000002 # Query # # use `db1`; insert into t1 (f1) values ('one'),('two')
+mysqld-relay-bin-master1.000002 # Query # # COMMIT
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first
+change master to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root' for channel 'master2';
+ERROR HY000: Connection 'master2' conflicts with existing connection 'master1'
+set default_master_connection = '';
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+start slave;
+include/wait_for_slave_to_start.inc
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
+connection master1;
+insert into t1 (f1) values ('three');
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+drop database if exists db2;
+create database db2;
+use db2;
+create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
+begin;
+insert into t1 (f1) values (1),(2);
+connection slave;
+connection master2;
+connection slave;
+select * from db1.t1;
+i f1
+1 one
+2 two
+3 three
+select * from db2.t1;
+pk f1
+connection master2;
+commit;
+connection slave;
+select * from db2.t1;
+pk f1
+1 1
+2 2
+connection master1;
+flush logs;
+connection slave;
+connection master1;
+purge binary logs to 'master-bin.000002';
+show binary logs;
+Log_name File_size
+master-bin.000002 filesize
+insert into t1 (f1) values ('four');
+create table db1.t3 (f1 int) engine=InnoDB;
+connection slave;
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
+#
+# MDEV:16437: merge 5.7 P_S replication instrumentation and tables
+#
+SELECT * FROM performance_schema.replication_applier_status_by_coordinator;
+CHANNEL_NAME master1
+THREAD_ID #
+SERVICE_STATE ON
+LAST_ERROR_NUMBER 0
+LAST_ERROR_MESSAGE
+LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00
+LAST_SEEN_TRANSACTION 0-1-7
+LAST_TRANS_RETRY_COUNT 0
+CHANNEL_NAME
+THREAD_ID #
+SERVICE_STATE ON
+LAST_ERROR_NUMBER 0
+LAST_ERROR_MESSAGE
+LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00
+LAST_SEEN_TRANSACTION 0-2-4
+LAST_TRANS_RETRY_COUNT 0
+select * from db1.t1;
+i f1
+1 one
+2 two
+3 three
+4 four
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000001 # Rotate # # mysqld-relay-bin.000002;pos=4
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
+mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000002 # Gtid_list # # []
+mysqld-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # drop database if exists db2
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # create database db2
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
+mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
+mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
+mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
+mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
+disconnect slave;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+stop slave io_thread;
+show status like 'Slave_running';
+Variable_name Value
+Slave_running OFF
+set default_master_connection = 'master1';
+show status like 'Slave_running';
+Variable_name Value
+Slave_running ON
+
+#
+# syntax compatible test
+#
+
+#
+# show relaylog events
+#
+SHOW RELAYLOG EVENTS for channel 'master1';
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000003 4 Format_desc 3 256 Server ver: Version
+mysqld-relay-bin-master1.000003 256 Rotate 1 1358 master-bin.000002;pos=4
+mysqld-relay-bin-master1.000003 304 Rotate 3 366 mysqld-relay-bin-master1.000004;pos=4
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# stop slave
+#
+STOP SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# start slave
+#
+START SLAVE for channel 'master1';
+include/wait_for_slave_to_start.inc
+connection master1;
+create table foo (a int);
+drop table foo;
+connection slave;
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000005'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# flush relay logs
+#
+FLUSH RELAY LOGS for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000006'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# stop slave
+#
+STOP SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000006'
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# reset slave
+#
+RESET SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = ''
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# show relaylog events after reset slave
+#
+SHOW RELAYLOG EVENTS for channel 'master1';
+Log_name Pos Event_type Server_id End_log_pos Info
+
+#
+# check error syntax
+#
+RESET SLAVE 'master1' for channel 'mmaster2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+STOP SLAVE 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+FLUSH RELAY LOGS 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+START SLAVE 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+SHOW RELAYLOG 'master1' EVENTS for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+SHOW SLAVE 'master1' STATUS for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+
+drop database db1;
+drop database db2;
+include/reset_master_slave.inc
+disconnect slave;
+connection master1;
+drop database db1;
+include/reset_master_slave.inc
+disconnect master1;
+connection master2;
+drop database db2;
+include/reset_master_slave.inc
+disconnect master2;
+connection default;
+CREATE TABLE channel (channel int);
+DROP TABLE channel;
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.test b/mysql-test/suite/multi_source/multisource_for_channel.test
new file mode 100644
index 00000000000..a95b272d5b1
--- /dev/null
+++ b/mysql-test/suite/multi_source/multisource_for_channel.test
@@ -0,0 +1,438 @@
+#
+# This is the basic test of support mysql syntax "for channel" used for
+# multi-source replication
+#
+# Test basic replication functionality in multi-source setup
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/binlog_start_pos.inc
+--let $rpl_server_count= 0
+
+RESET MASTER;
+
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+# MDEV-3984: crash/read of freed memory when changing master with named connection
+# This fails after adding the new master 'abc1', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master to relay_log_file='' for channel 'abc1';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master to master_host='' for channel 'abc2';
+
+# Start replication from the first master
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+
+start slave for channel 'master1';
+set default_master_connection = 'master1';
+--source include/wait_for_slave_to_start.inc
+
+--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+# Here and further: add an extra check on SQL thread status
+# as the normal sync is not always enough
+--source include/wait_for_sql_thread_read_all.inc
+
+# each of the 3 commands should produce
+# 'master1' status
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW SLAVE 'master1' STATUS
+--echo #
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let for_channel= 1
+--source include/show_slave_status.inc
+--let $slave_name=
+--let for_channel=
+
+--echo #
+--echo # Checking SHOW SLAVE STATUS
+--echo #
+--source include/show_slave_status.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+
+# Check that replication actually works
+
+--connection master1
+
+--disable_warnings
+drop database if exists db1;
+--enable_warnings
+create database db1;
+use db1;
+create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+insert into t1 (f1) values ('one'),('two');
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--sorted_result
+select * from db1.t1;
+
+--let $datadir = `SELECT @@datadir`
+
+--echo # List of relay log files in the datadir
+--list_files $datadir mysqld-relay-bin-master1.*
+
+# Check that relay logs are recognizable
+
+let binlog_start=4;
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin-master1.000002;
+source include/show_relaylog_events.inc;
+
+# Try to configure connection with the same name again,
+# should get an error because the slave is running
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+
+# Try to configure using the default connection name
+# (which is 'master1' at the moment),
+# again, should get an error
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+# Try to configure a connection with the same master
+# using a different name, should get a conflict
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+--error ER_CONNECTION_ALREADY_EXISTS
+eval change master to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root' for channel 'master2';
+
+
+# Set up a proper 'default' connection to master2
+
+set default_master_connection = '';
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+--source include/wait_for_sql_thread_read_all.inc
+
+# See both connections in the same status output
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+# Check that replication from two servers actually works
+
+--connection master1
+
+insert into t1 (f1) values ('three');
+--save_master_pos
+
+--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+
+--disable_warnings
+drop database if exists db2;
+--enable_warnings
+create database db2;
+use db2;
+create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
+begin;
+insert into t1 (f1) values (1),(2);
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--connection master2
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db1.t1;
+select * from db2.t1;
+
+--connection master2
+commit;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db2.t1;
+
+# Flush and purge logs on one master,
+# make sure slaves don't get confused
+
+--connection master1
+flush logs;
+--source include/wait_for_binlog_checkpoint.inc
+--save_master_pos
+--connection slave
+--sync_with_master 0, 'master1'
+
+--connection master1
+purge binary logs to 'master-bin.000002';
+# Additional events: 43 (Gtid_list) + 2 x 44 (Binlog_checkpoint) = 131
+let filesize=`select $binlog_start_pos+131`;
+--replace_result $filesize filesize
+show binary logs;
+insert into t1 (f1) values ('four');
+create table db1.t3 (f1 int) engine=InnoDB;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--source include/wait_for_sql_thread_read_all.inc
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+--echo #
+--echo # MDEV:16437: merge 5.7 P_S replication instrumentation and tables
+--echo #
+--replace_column 2 #
+query_vertical SELECT * FROM performance_schema.replication_applier_status_by_coordinator;
+
+--sorted_result
+select * from db1.t1;
+
+# This should show relay log events for the default master
+# (the one with the empty name)
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin.000002;
+source include/show_relaylog_events.inc;
+
+# Make sure we don't lose control over replication connections
+# after reconnecting to the slave
+
+--disconnect slave
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+stop slave io_thread;
+show status like 'Slave_running';
+set default_master_connection = 'master1';
+show status like 'Slave_running';
+
+--echo
+--echo #
+--echo # syntax compatible test
+--echo #
+--echo
+--echo #
+--echo # show relaylog events
+--echo #
+--replace_regex /Server ver:.*/Server ver: Version/
+SHOW RELAYLOG EVENTS for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # stop slave
+--echo #
+STOP SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # start slave
+--echo #
+START SLAVE for channel 'master1';
+--source include/wait_for_slave_to_start.inc
+
+# Force some data into the relay log to ensure that we get a new relay log
+--connection master1
+create table foo (a int);
+drop table foo;
+--save_master_pos
+--connection slave
+--sync_with_master 0,'master1'
+--source include/wait_for_sql_thread_read_all.inc
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /Preparing/Yes/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # flush relay logs
+--echo #
+FLUSH RELAY LOGS for channel 'master1';
+--source include/wait_for_sql_thread_read_all.inc
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # stop slave
+--echo #
+STOP SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # reset slave
+--echo #
+RESET SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # show relaylog events after reset slave
+--echo #
+SHOW RELAYLOG EVENTS for channel 'master1';
+
+--let $slave_name=
+--let for_channel=
+
+--echo
+--echo #
+--echo # check error syntax
+--echo #
+--error ER_WRONG_ARGUMENTS
+RESET SLAVE 'master1' for channel 'mmaster2';
+--error ER_WRONG_ARGUMENTS
+STOP SLAVE 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+FLUSH RELAY LOGS 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+START SLAVE 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+SHOW RELAYLOG 'master1' EVENTS for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+SHOW SLAVE 'master1' STATUS for channel 'master2';
+
+--echo
+# Cleanup
+drop database db1;
+drop database db2;
+
+--source include/reset_master_slave.inc
+--disconnect slave
+
+--connection master1
+drop database db1;
+--source include/reset_master_slave.inc
+--disconnect master1
+
+--connection master2
+drop database db2;
+--source include/reset_master_slave.inc
+--disconnect master2
+
+#
+# Check channel as a keyword
+#
+--connection default
+CREATE TABLE channel (channel int);
+DROP TABLE channel;
diff --git a/mysql-test/suite/parts/inc/engines.combinations b/mysql-test/suite/parts/inc/engines.combinations
new file mode 100644
index 00000000000..17e01265006
--- /dev/null
+++ b/mysql-test/suite/parts/inc/engines.combinations
@@ -0,0 +1,8 @@
+[innodb]
+default-storage-engine=innodb
+
+[myisam]
+default-storage-engine=myisam
+
+[aria]
+default-storage-engine=aria
diff --git a/mysql-test/suite/parts/inc/engines.inc b/mysql-test/suite/parts/inc/engines.inc
new file mode 100644
index 00000000000..b8995ef08ec
--- /dev/null
+++ b/mysql-test/suite/parts/inc/engines.inc
@@ -0,0 +1,4 @@
+--source include/have_innodb.inc
+
+let $engine= `select @@default_storage_engine`;
+
diff --git a/mysql-test/suite/parts/inc/partition.pre b/mysql-test/suite/parts/inc/partition.pre
index fba909687a0..3c9bbe9a6a6 100644
--- a/mysql-test/suite/parts/inc/partition.pre
+++ b/mysql-test/suite/parts/inc/partition.pre
@@ -51,7 +51,7 @@ let $ER_PARSE_ERROR= 1064;
let $ER_TOO_MANY_PARTITIONS_ERROR= 1499;
let $ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF= 1503;
let $ER_NO_PARTS_ERROR= 1504;
-let $ER_DROP_PARTITION_NON_EXISTENT= 1507;
+let $ER_PARTITION_DOES_NOT_EXIST= 1507;
let $ER_SAME_NAME_PARTITION= 1517;
let $ER_NO_PARTITION_FOR_GIVEN_VALUE= 1526;
diff --git a/mysql-test/suite/parts/inc/partition_alter_1.inc b/mysql-test/suite/parts/inc/partition_alter_1.inc
index b62efd24072..a348407ac60 100644
--- a/mysql-test/suite/parts/inc/partition_alter_1.inc
+++ b/mysql-test/suite/parts/inc/partition_alter_1.inc
@@ -40,7 +40,7 @@ eval $insert_first_half;
# 0
# 1030: ER_GET_ERRNO
# 1502: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
-# 1506: ER_DROP_PARTITION_NON_EXISTENT
+# 1506: ER_PARTITION_DOES_NOT_EXIST
--disable_abort_on_error
eval $alter;
--enable_abort_on_error
@@ -52,10 +52,10 @@ eval SET @my_errno = $mysql_errno;
let $run_test= `SELECT @my_errno = 0`;
if (`SELECT @my_errno NOT IN (0,$ER_GET_ERRNO,
$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,
- $ER_DROP_PARTITION_NON_EXISTENT)`);
+ $ER_PARTITION_DOES_NOT_EXIST)`);
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_DROP_PARTITION_NON_EXISTENT
+ --echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_PARTITION_DOES_NOT_EXIST
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
--echo # Please check the error name to number mapping in inc/partition.pre.
diff --git a/mysql-test/suite/parts/inc/partition_fail.inc b/mysql-test/suite/parts/inc/partition_fail.inc
index dd79cdf1dc8..bbe5924e358 100644
--- a/mysql-test/suite/parts/inc/partition_fail.inc
+++ b/mysql-test/suite/parts/inc/partition_fail.inc
@@ -2,8 +2,10 @@
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--let $dbug_flag= `select @@session.debug_dbug`
+--echo # $dbug_flag: BEFORE failure
--replace_result #p# #P# #sp# #SP#
+--let $DATADIR= `select @@datadir`
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
@@ -11,7 +13,7 @@ SELECT * FROM t1;
--disable_abort_on_error
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
@@ -19,10 +21,9 @@ SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
---echo # Same test under LOCK TABLE
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--echo # $dbug_flag: BEFORE failure (under LOCK TABLE)
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
@@ -32,7 +33,7 @@ LOCK TABLE t1 WRITE;
--disable_abort_on_error
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure (under LOCK TABLE)
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/parts/inc/partition_fail_t2.inc b/mysql-test/suite/parts/inc/partition_fail_t2.inc
index 492e6d5a71b..301fb005255 100644
--- a/mysql-test/suite/parts/inc/partition_fail_t2.inc
+++ b/mysql-test/suite/parts/inc/partition_fail_t2.inc
@@ -2,30 +2,40 @@
# To be used with WL#4445: EXCHANGE PARTITION WITH TABLE.
--eval $create_statement2
--eval $insert_statement2
-SHOW CREATE TABLE t2;
---sorted_result
-SELECT * FROM t2;
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--let $dbug_flag= `select @@session.debug_dbug`
+--echo # $dbug_flag: BEFORE failure
--replace_result #p# #P#
+if (!$DATADIR)
+{
+ --let $DATADIR= `SELECT @@datadir;`
+}
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
+SHOW CREATE TABLE t2;
+--sorted_result
+SELECT * FROM t2;
# accept all errors
--disable_abort_on_error
--replace_regex /#sql-exchange-[0-9a-f_\-]*/#sql-exchange/i
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure
--replace_result #p# #P#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
+--error 0, ER_NO_SUCH_TABLE
SHOW CREATE TABLE t2;
--sorted_result
+--error 0, ER_NO_SUCH_TABLE
SELECT * FROM t2;
+# TODO: everything fails with ER_NO_SUCH_TABLE
+# but DROP TABLE fails with ER_BAD_TABLE_ERROR! Why?
+--error 0, ER_BAD_TABLE_ERROR
DROP TABLE t2;
diff --git a/mysql-test/suite/parts/r/alter_table,list.rdiff b/mysql-test/suite/parts/r/alter_table,list.rdiff
new file mode 100644
index 00000000000..391216bc47c
--- /dev/null
+++ b/mysql-test/suite/parts/r/alter_table,list.rdiff
@@ -0,0 +1,85 @@
+@@ -142,13 +142,13 @@
+ partition pn values less than maxvalue);
+ ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
+ create or replace table t1 (x int)
+-partition by range(x) (
+-partition p1 values less than (10),
+-partition p2 values less than (20),
+-partition p3 values less than (30),
+-partition p4 values less than (40),
+-partition p5 values less than (50),
+-partition pn values less than maxvalue);
++partition by list(x) (
++partition p1 values in (2, 3, 4),
++partition p2 values in (12, 13, 14),
++partition p3 values in (22, 23, 24),
++partition p4 values in (32, 33, 34),
++partition p5 values in (42, 43, 44),
++partition pn values in (52, 53, 54));
+ insert into t1 values (2), (12), (22), (32), (42), (52);
+ create or replace table tp2 (y int);
+ insert tp2 values (88);
+@@ -188,12 +188,12 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+- PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p3` VALUES IN (22,23,24) ENGINE = X,
++ PARTITION `p4` VALUES IN (32,33,34) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -218,11 +218,11 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p4` VALUES IN (32,33,34) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -248,10 +248,10 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -273,9 +273,9 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
diff --git a/mysql-test/suite/parts/r/alter_table.result b/mysql-test/suite/parts/r/alter_table.result
index 0901584c6f8..b887cea36f0 100644
--- a/mysql-test/suite/parts/r/alter_table.result
+++ b/mysql-test/suite/parts/r/alter_table.result
@@ -28,3 +28,319 @@ ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
ERROR 42000: Can't open table
DROP VIEW v1;
DROP TABLE t1, t2;
+#
+# MDEV-22165 CONVERT PARTITION: move in partition from existing table
+#
+create or replace table tp1 (a int);
+create or replace table t1 (a int)
+partition by hash (a) partitions 2;
+alter table t1 convert table tp1 to partition p2;
+ERROR HY000: CONVERT TABLE TO PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (a int)
+partition by range (a)
+(partition p0 values less than (0));
+alter table t1 convert table non_existent to partition p1 values less than (10);
+ERROR 42S02: Table 'test.non_existent' doesn't exist
+alter table t1 convert table tp1 to partition p1 values less than (10);
+show create table tp1;
+ERROR 42S02: Table 'test.tp1' doesn't exist
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X)
+create table tp2 (x int);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Tables have different definitions
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X)
+create or replace table tp2 (a int);
+insert tp2 values (1), (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (1), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (17), (1);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+show create table tp2;
+ERROR 42S02: Table 'test.tp2' doesn't exist
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = X)
+select * from t1 partition (p2);
+a
+15
+17
+create or replace table t1 (a int)
+partition by range (a) (
+p0 values less than (0),
+pn values less than (30));
+insert into t1 values (1);
+create or replace table tp1 (a int);
+insert into tp1 values (2);
+alter table t1 convert table tp1 to partition p1 values less than (10);
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+drop tables t1, tp1;
+#
+# MDEV-22166 CONVERT PARTITION: move out partition into a table
+#
+create or replace table t1 (x int);
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Partition management on a not partitioned table is not possible
+create or replace table t1 (x int)
+partition by hash(x) partitions 2;
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: CONVERT PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (x int)
+partition by key(x) partitions 2;
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: CONVERT PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (x int)
+partition by range(x)
+subpartition by hash(x) subpartitions 3 (
+partition p1 values less than (10),
+partition pn values less than maxvalue);
+alter table t1 convert partition p1 to table p1;
+ERROR HY000: Convert partition is not supported for subpartitioned table.
+alter table t1 convert partition p1sp0 to table p1;
+ERROR HY000: Wrong partition name or partition list
+create or replace table t1 (x int)
+partition by range(x) (
+partition p1 values less than (10));
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
+create or replace temporary table t1 (x int)
+partition by range(x) (
+partition p0 values less than (10),
+partition pn values less than maxvalue);
+ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
+create or replace table t1 (x int)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+create or replace table tp2 (y int);
+insert tp2 values (88);
+alter table t1 convert partition p2 to table tp2, drop partition p3;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' drop partition p3' at line 1
+alter table t1 convert partition p00 to table tp00;
+ERROR HY000: Wrong partition name or partition list
+alter table t1 convert partition p00 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+alter table t1 convert partition p2 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+create trigger tr1 before update on t1 for each row
+begin
+alter table t1 convert partition p2 to table tp2;
+end$
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger
+create function f1() returns int
+begin
+alter table t1 convert partition p2 to table tp2;
+end$
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger
+select * from tp2;
+y
+88
+drop table tp2;
+alter table t1 convert partition p2 to table tp2;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from tp2;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+22
+32
+42
+52
+alter table t1 convert partition p3 to table inexistent.tp3;
+ERROR 42000: Unknown database 'inexistent'
+create database EXISTENT;
+alter table t1 convert partition p3 to table EXISTENT.TP3;
+show create table EXISTENT.TP3;
+Table Create Table
+TP3 CREATE TABLE `TP3`-ok (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from EXISTENT.TP3 order by x;
+x
+22
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+32
+42
+52
+# LOCK TABLES
+lock tables t1 write;
+alter table t1 convert partition p4 to table tp4;
+show create table tp4;
+ERROR HY000: Table 'tp4' was not locked with LOCK TABLES
+unlock tables;
+show create table tp4;
+Table Create Table
+tp4 CREATE TABLE `tp4` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from tp4;
+x
+32
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+42
+52
+# PS
+prepare stmt from 'alter table t1 convert partition p5 to table tp5';
+execute stmt;
+show create table tp5;
+Table Create Table
+tp5 CREATE TABLE `tp5` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from tp5;
+x
+42
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+52
+drop table tp5;
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+drop prepare stmt;
+# Privileges
+create user alan;
+grant usage on *.* to alan;
+grant create, insert, drop on test.* to alan;
+connect alan,localhost,alan,,test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, DROP ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: ALTER command denied to user 'alan'@'localhost' for table `test`.`t1`
+connection default;
+revoke all on test.* from alan;
+grant create, insert, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: DROP command denied to user 'alan'@'localhost' for table `test`.`t1`
+connection default;
+revoke all on test.* from alan;
+grant create, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT CREATE, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: INSERT command denied to user 'alan'@'localhost' for table `test`.`tp1`
+connection default;
+revoke all on test.* from alan;
+grant insert, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: CREATE command denied to user 'alan'@'localhost' for table `test`.`tp1`
+connection default;
+grant create, insert, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+disconnect alan;
+connection default;
+drop database EXISTENT;
+drop user alan;
+drop tables t1, tp1, tp2, tp4;
diff --git a/mysql-test/suite/parts/r/debug_innodb_fail.result b/mysql-test/suite/parts/r/debug_innodb_fail.result
index 3d7b19a7f32..b57925eb073 100644
--- a/mysql-test/suite/parts/r/debug_innodb_fail.result
+++ b/mysql-test/suite/parts/r/debug_innodb_fail.result
@@ -19,7 +19,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -47,7 +47,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -73,14 +73,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -109,7 +108,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -144,7 +143,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -172,7 +171,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -198,14 +197,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -234,7 +232,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -269,7 +267,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -297,7 +295,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -323,14 +321,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -359,7 +356,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -394,7 +391,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -422,7 +419,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -448,14 +445,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -484,7 +480,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -519,7 +515,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -547,7 +543,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -573,14 +569,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -609,7 +604,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -644,7 +639,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -672,7 +667,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -698,14 +693,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -734,7 +728,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -769,7 +763,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -797,7 +791,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -823,14 +817,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -859,7 +852,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -894,7 +887,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -922,7 +915,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -950,14 +943,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -986,7 +978,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1023,7 +1015,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1051,7 +1043,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1079,14 +1071,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1115,7 +1106,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1152,7 +1143,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1180,7 +1171,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1208,14 +1199,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1244,7 +1234,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1283,7 +1273,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1310,7 +1300,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1336,14 +1326,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1371,7 +1360,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1406,7 +1395,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1433,7 +1422,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1459,14 +1448,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1494,7 +1482,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1529,7 +1517,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1556,7 +1544,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1582,14 +1570,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1617,7 +1604,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1652,7 +1639,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1679,7 +1666,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1699,14 +1686,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1734,7 +1720,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1763,7 +1749,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1790,7 +1776,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1810,14 +1796,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1845,7 +1830,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1874,7 +1859,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1901,7 +1886,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1921,14 +1906,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1956,7 +1940,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1985,7 +1969,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2012,7 +1996,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2032,14 +2016,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2067,7 +2050,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2096,7 +2079,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2123,7 +2106,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2143,14 +2126,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2178,7 +2160,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2207,7 +2189,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2234,7 +2216,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2254,14 +2236,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2289,7 +2270,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2321,7 +2302,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2350,7 +2331,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2376,14 +2357,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2413,7 +2393,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2448,7 +2428,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2477,7 +2457,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2503,14 +2483,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2540,7 +2519,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2575,7 +2554,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2604,7 +2583,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2630,14 +2609,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2667,7 +2645,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2702,7 +2680,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2731,7 +2709,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2757,14 +2735,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2794,7 +2771,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2829,7 +2806,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2858,7 +2835,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2884,14 +2861,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2921,7 +2897,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2956,7 +2932,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2985,7 +2961,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3011,14 +2987,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3048,7 +3023,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3083,7 +3058,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3112,7 +3087,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3140,14 +3115,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3177,7 +3151,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3214,7 +3188,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3243,7 +3217,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3271,14 +3245,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3308,7 +3281,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3345,7 +3318,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3374,7 +3347,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3402,14 +3375,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3439,7 +3411,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3476,7 +3448,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3505,7 +3477,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3533,14 +3505,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3570,7 +3541,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3607,7 +3578,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3636,7 +3607,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3664,14 +3635,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3701,7 +3671,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3738,7 +3708,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3767,7 +3737,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3795,14 +3765,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3832,7 +3801,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
diff --git a/mysql-test/suite/parts/r/debug_myisam_fail.result b/mysql-test/suite/parts/r/debug_myisam_fail.result
index 117f6ffbdac..708ce222826 100644
--- a/mysql-test/suite/parts/r/debug_myisam_fail.result
+++ b/mysql-test/suite/parts/r/debug_myisam_fail.result
@@ -16,7 +16,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -46,7 +46,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -74,14 +74,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -112,7 +111,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -149,7 +148,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -179,7 +178,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -207,14 +206,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -245,7 +243,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -282,7 +280,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -312,7 +310,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -340,14 +338,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -378,7 +375,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -415,7 +412,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -445,7 +442,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -473,14 +470,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -511,7 +507,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -548,7 +544,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -578,7 +574,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -606,14 +602,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -644,7 +639,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -681,7 +676,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -711,7 +706,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -739,14 +734,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -777,7 +771,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -814,7 +808,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -844,7 +838,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -872,14 +866,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -910,7 +903,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -947,7 +940,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -977,7 +970,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1008,14 +1001,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1046,7 +1038,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1086,7 +1078,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1116,7 +1108,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1147,14 +1139,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1185,7 +1176,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1225,7 +1216,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1255,7 +1246,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1286,14 +1277,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1324,7 +1314,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1366,7 +1356,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1395,7 +1385,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1423,14 +1413,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1460,7 +1449,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1497,7 +1486,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1526,7 +1515,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1554,14 +1543,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1591,7 +1579,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1628,7 +1616,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1657,7 +1645,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1685,14 +1673,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1722,7 +1709,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1759,7 +1746,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1788,7 +1775,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1809,14 +1796,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1846,7 +1832,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1876,7 +1862,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1905,7 +1891,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1926,14 +1912,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1963,7 +1948,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1993,7 +1978,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2022,7 +2007,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2043,14 +2028,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2080,7 +2064,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2110,7 +2094,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2139,7 +2123,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2160,14 +2144,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2197,7 +2180,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2227,7 +2210,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2256,7 +2239,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2277,14 +2260,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2314,7 +2296,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2344,7 +2326,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2373,7 +2355,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2394,14 +2376,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2431,7 +2412,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2464,7 +2445,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2495,7 +2476,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2523,14 +2504,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2562,7 +2542,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2599,7 +2579,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2630,7 +2610,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2658,14 +2638,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2697,7 +2676,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2734,7 +2713,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2765,7 +2744,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2793,14 +2772,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2832,7 +2810,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2869,7 +2847,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2900,7 +2878,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2928,14 +2906,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2967,7 +2944,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3004,7 +2981,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3035,7 +3012,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3063,14 +3040,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3102,7 +3078,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3139,7 +3115,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3170,7 +3146,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3198,14 +3174,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3237,7 +3212,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3274,7 +3249,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3305,7 +3280,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3336,14 +3311,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3375,7 +3349,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3415,7 +3389,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3446,7 +3420,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3477,14 +3451,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3516,7 +3489,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3556,7 +3529,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3587,7 +3560,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3618,14 +3591,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3657,7 +3629,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3697,7 +3669,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3728,7 +3700,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3759,14 +3731,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3798,7 +3769,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3838,7 +3809,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3869,7 +3840,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3900,14 +3871,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3939,7 +3909,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3979,7 +3949,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4010,7 +3980,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4041,14 +4011,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4080,7 +4049,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
diff --git a/mysql-test/suite/parts/r/engine_defined_part_attributes.result b/mysql-test/suite/parts/r/engine_defined_part_attributes.result
new file mode 100644
index 00000000000..fe7a89fdf52
--- /dev/null
+++ b/mysql-test/suite/parts/r/engine_defined_part_attributes.result
@@ -0,0 +1,288 @@
+#
+# MDEV-5271 Support engine-defined attributes per partition
+#
+# partitioned tables
+CREATE TABLE `t1` (
+`id` INT
+) ENGINE=InnoDB ENCRYPTED="YES" PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" ENCRYPTION_KEY_ID=1,
+PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT" ENCRYPTION_KEY_ID=1
+);
+SHOW CREATE TABLE `t1`;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='YES'
+ PARTITION BY RANGE (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB ENCRYPTED = 'NO' ENCRYPTION_KEY_ID = 1,
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE ENGINE = InnoDB ENCRYPTED = 'DEFAULT' ENCRYPTION_KEY_ID = 1)
+INSERT INTO t1 VALUES (1), (2), (3);
+DELETE FROM t1 WHERE id = 1;
+UPDATE t1 SET id = 4 WHERE id = 3;
+SELECT * FROM t1 WHERE id IN (2, 3);
+id
+2
+DROP TABLE `t1`;
+CREATE TABLE `t2` (
+`id` INT
+) ENGINE=InnoDB ENCRYPTED="YES" ENCRYPTION_KEY_ID=2 PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100),
+PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options")
+CREATE TABLE `t3` (
+`id` INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" ENCRYPTION_KEY_ID=2,
+PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options")
+CREATE TABLE `t4` (
+`id` INT
+) ENGINE=InnoDB ENCRYPTED="NO";
+SHOW CREATE TABLE `t4`;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='NO'
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO",
+PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT"
+);
+SHOW CREATE TABLE `t4`;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='NO'
+ PARTITION BY RANGE (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB ENCRYPTED = 'NO',
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE ENGINE = InnoDB ENCRYPTED = 'DEFAULT')
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100),
+PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t4`;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='NO'
+ PARTITION BY RANGE (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB,
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" ENCRYPTION_KEY_ID=2,
+PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT"
+);
+ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
+DROP TABLE `t4`;
+# subpartitioned tables
+CREATE TABLE `t5` (
+`id` INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id)
+SUBPARTITIONS 2 (
+PARTITION pt1 VALUES LESS THAN (100),
+PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t5`;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='NO'
+ PARTITION BY RANGE (`id`)
+SUBPARTITION BY HASH (`id`)
+SUBPARTITIONS 2
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB,
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
+DROP TABLE `t5`;
+CREATE TABLE `t6` (
+`id` INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id)
+SUBPARTITIONS 2 (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES",
+PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+ERROR HY000: Can't create table `test`.`t6` (errno: 140 "Wrong create options")
+CREATE TABLE `t7` (
+id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+PARTITION pt1 VALUES LESS THAN (100)(
+SUBPARTITION spt1 ENCRYPTED="NO",
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE (
+SUBPARTITION spt3,
+SUBPARTITION spt4
+)
+);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ENCRYPTED="NO",
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE ...' at line 6
+CREATE TABLE `t8` (
+id INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+PARTITION pt1 VALUES LESS THAN (100) (
+SUBPARTITION spt1,
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE (
+SUBPARTITION spt3,
+SUBPARTITION spt4
+)
+);
+SHOW CREATE TABLE `t8`;
+Table Create Table
+t8 CREATE TABLE `t8` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='NO'
+ PARTITION BY RANGE (`id`)
+SUBPARTITION BY HASH (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100)
+ (SUBPARTITION `spt1` ENGINE = InnoDB,
+ SUBPARTITION `spt2` ENGINE = InnoDB),
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE
+ (SUBPARTITION `spt3` ENGINE = InnoDB,
+ SUBPARTITION `spt4` ENGINE = InnoDB))
+DROP TABLE `t8`;
+CREATE TABLE `t9` (
+id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" (
+SUBPARTITION spt1,
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE (
+SUBPARTITION spt3,
+SUBPARTITION spt4
+)
+);
+SHOW CREATE TABLE `t9`;
+Table Create Table
+t9 CREATE TABLE `t9` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`id`)
+SUBPARTITION BY HASH (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100)
+ (SUBPARTITION `spt1` ENGINE = InnoDB,
+ SUBPARTITION `spt2` ENGINE = InnoDB),
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE
+ (SUBPARTITION `spt3` ENGINE = InnoDB,
+ SUBPARTITION `spt4` ENGINE = InnoDB))
+DROP TABLE `t9`;
+CREATE TABLE `t10` (
+id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" (
+SUBPARTITION spt1,
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE (
+SUBPARTITION spt3,
+SUBPARTITION spt4
+)
+);
+ERROR HY000: Can't create table `test`.`t10` (errno: 140 "Wrong create options")
+CREATE TABLE `t11` (
+id INT
+) ENGINE=InnoDB ENCRYPTED="YES" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" (
+SUBPARTITION spt1,
+SUBPARTITION spt2
+),
+PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="NO" (
+SUBPARTITION spt3,
+SUBPARTITION spt4
+)
+);
+SHOW CREATE TABLE `t11`;
+Table Create Table
+t11 CREATE TABLE `t11` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`='YES'
+ PARTITION BY RANGE (`id`)
+SUBPARTITION BY HASH (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100)
+ (SUBPARTITION `spt1` ENGINE = InnoDB,
+ SUBPARTITION `spt2` ENGINE = InnoDB),
+ PARTITION `pt2` VALUES LESS THAN MAXVALUE
+ (SUBPARTITION `spt3` ENGINE = InnoDB,
+ SUBPARTITION `spt4` ENGINE = InnoDB))
+DROP TABLE `t11`;
+#
+# MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values
+#
+# restart: --innodb-sys-tablespaces
+CREATE TABLE `t12` (
+id INT
+) ENGINE=InnoDB PARTITION BY HASH(id)
+(
+pt1 PAGE_COMPRESSED=0
+);
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+name flag
+test/t12#P#pt1 21
+ALTER TABLE `t12` ADD PARTITION (
+PARTITION pt2 PAGE_COMPRESSED=1
+);
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+name flag
+test/t12#P#pt1 21
+test/t12#P#pt2 1610612789
+ALTER TABLE `t12` ADD PARTITION (
+PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3
+);
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+name flag
+test/t12#P#pt1 21
+test/t12#P#pt2 1610612789
+test/t12#P#pt3 805306421
+DROP TABLE `t12`;
+CREATE TABLE `t13` (
+`id` INT
+) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0,
+PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
+PARTITION pt3 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t13`;
+Table Create Table
+t13 CREATE TABLE `t13` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `PAGE_COMPRESSED`=1
+ PARTITION BY RANGE (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 0,
+ PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3,
+ PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
+name flag
+test/t13#P#pt1 21
+test/t13#P#pt2 805306421
+test/t13#P#pt3 1610612789
+ALTER TABLE `t13` PARTITION BY RANGE(id) (
+PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
+PARTITION pt2 VALUES LESS THAN (200),
+PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0
+);
+SHOW CREATE TABLE `t13`;
+Table Create Table
+t13 CREATE TABLE `t13` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `PAGE_COMPRESSED`=1
+ PARTITION BY RANGE (`id`)
+(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3,
+ PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB,
+ PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB PAGE_COMPRESSED = 0)
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
+name flag
+test/t13#P#pt1 805306421
+test/t13#P#pt2 1610612789
+test/t13#P#pt3 21
+DROP TABLE `t13`;
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index c9a80c6035b..aab121f2b23 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -7592,7 +7592,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8052,7 +8052,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8523,7 +8523,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8995,7 +8995,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9461,7 +9461,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9933,7 +9933,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10410,7 +10410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10885,7 +10885,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11350,7 +11350,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11810,7 +11810,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12281,7 +12281,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12753,7 +12753,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13219,7 +13219,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13691,7 +13691,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14168,7 +14168,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14643,7 +14643,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26393,7 +26393,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26853,7 +26853,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27324,7 +27324,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27796,7 +27796,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28262,7 +28262,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28734,7 +28734,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29211,7 +29211,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29686,7 +29686,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30151,7 +30151,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30611,7 +30611,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31082,7 +31082,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31554,7 +31554,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32020,7 +32020,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32492,7 +32492,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32969,7 +32969,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33444,7 +33444,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45202,7 +45202,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45662,7 +45662,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46133,7 +46133,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46605,7 +46605,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47071,7 +47071,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47543,7 +47543,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48020,7 +48020,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48495,7 +48495,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48960,7 +48960,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49420,7 +49420,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49891,7 +49891,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50363,7 +50363,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50829,7 +50829,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51301,7 +51301,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51778,7 +51778,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52253,7 +52253,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -63970,7 +63970,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -63985,7 +63985,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64008,7 +64008,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64029,7 +64029,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64048,7 +64048,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64071,7 +64071,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64094,7 +64094,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64113,7 +64113,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
@@ -64130,7 +64130,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64145,7 +64145,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64168,7 +64168,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64189,7 +64189,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64208,7 +64208,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64231,7 +64231,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64254,7 +64254,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64273,7 +64273,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
@@ -75552,7 +75552,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76012,7 +76012,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76483,7 +76483,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76955,7 +76955,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77421,7 +77421,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77893,7 +77893,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78370,7 +78370,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78845,7 +78845,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79310,7 +79310,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79770,7 +79770,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80241,7 +80241,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80713,7 +80713,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81179,7 +81179,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81651,7 +81651,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82128,7 +82128,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82603,7 +82603,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result
index 4e9e5c83248..c863d479fbb 100644
--- a/mysql-test/suite/parts/r/partition_alter4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result
@@ -7888,7 +7888,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8357,7 +8357,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8843,7 +8843,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9336,7 +9336,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9819,7 +9819,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10312,7 +10312,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10810,7 +10810,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11306,7 +11306,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11794,7 +11794,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12263,7 +12263,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12749,7 +12749,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13242,7 +13242,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13725,7 +13725,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14218,7 +14218,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14716,7 +14716,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -15212,7 +15212,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27429,7 +27429,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27898,7 +27898,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28384,7 +28384,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28877,7 +28877,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29360,7 +29360,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29853,7 +29853,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30351,7 +30351,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30847,7 +30847,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31335,7 +31335,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31804,7 +31804,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32290,7 +32290,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32783,7 +32783,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33266,7 +33266,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33759,7 +33759,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34257,7 +34257,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34753,7 +34753,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46962,7 +46962,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47431,7 +47431,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47917,7 +47917,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48410,7 +48410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48893,7 +48893,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49386,7 +49386,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49884,7 +49884,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50380,7 +50380,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50868,7 +50868,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51337,7 +51337,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51823,7 +51823,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52316,7 +52316,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52799,7 +52799,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53292,7 +53292,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53790,7 +53790,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -54286,7 +54286,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -66462,7 +66462,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66477,7 +66477,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66500,7 +66500,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66521,7 +66521,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66540,7 +66540,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66563,7 +66563,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66586,7 +66586,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66605,7 +66605,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
@@ -66622,7 +66622,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66637,7 +66637,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66660,7 +66660,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66681,7 +66681,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66700,7 +66700,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66723,7 +66723,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66746,7 +66746,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66765,7 +66765,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
@@ -78488,7 +78488,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78957,7 +78957,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79443,7 +79443,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79936,7 +79936,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80419,7 +80419,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80912,7 +80912,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81410,7 +81410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81906,7 +81906,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82394,7 +82394,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82863,7 +82863,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83349,7 +83349,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83842,7 +83842,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84325,7 +84325,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84818,7 +84818,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85316,7 +85316,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85812,7 +85812,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result
index b24ce29d028..5aae648dd1c 100644
--- a/mysql-test/suite/parts/r/partition_debug.result
+++ b/mysql-test/suite/parts/r/partition_debug.result
@@ -1025,23 +1025,11 @@ SET @save_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_1";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1075,9 +1063,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1129,23 +1129,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_2";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1179,9 +1167,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1233,23 +1233,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_3";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1283,9 +1271,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t2' to './test/#sql-exchange' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1337,23 +1337,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_4";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1387,9 +1375,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1441,23 +1441,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_5";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1491,9 +1479,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t1#P#p0' to './test/t2' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1545,23 +1545,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_6";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1595,9 +1583,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1649,23 +1649,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_7";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1699,9 +1687,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/#sql-exchange' to './test/t1#P#p0' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1753,23 +1753,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_8";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1803,9 +1791,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1857,23 +1857,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_9";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1907,9 +1895,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1958,3 +1958,3229 @@ a b
4 Original from partition p0
DROP TABLE t2;
SET SESSION debug_dbug=@save_dbug;
+#
+# MDEV-22165 CONVERT PARTITION: move in partition from existing table
+#
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_1: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_2: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_3: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_4: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_5: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_6: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_7: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_8: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_9: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_11: BEFORE failure
+db.opt
+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.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_11: AFTER failure
+db.opt
+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#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+#
+# MDEV-22166 CONVERT PARTITION: move out partition into a table
+#
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_create_before_create_frm";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_create_before_create_frm: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_create_before_create_frm: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_create_before_create_frm: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_create_before_create_frm: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_alter_partition_after_write_frm";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_alter_partition_after_write_frm: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_alter_partition_after_write_frm: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_alter_partition_after_write_frm: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_alter_partition_after_write_frm: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,error_convert_partition_00";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,error_convert_partition_00: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Error on rename of './test/t1#P#p2' to './test/tp2' (errno: 137 "No more records (read after end of file)")
+# d,error_convert_partition_00: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,error_convert_partition_00: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Error on rename of './test/t1#P#p2' to './test/tp2' (errno: 137 "No more records (read after end of file)")
+# d,error_convert_partition_00: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_1: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_1: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_2: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_2: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_3: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_3: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_4: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_4: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_5: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_5: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_6: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_6: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_7: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_7: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_8: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_8: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_9: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_9: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+# Already finished DDL logging, so tp2 now exists:
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_11: BEFORE failure
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_11: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_11: BEFORE failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+# d,fail_convert_partition_11: AFTER failure (under LOCK TABLE)
+db.opt
+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#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from tp2;
+x
+12
+drop table tp2;
diff --git a/mysql-test/suite/parts/r/partition_debug_innodb.result b/mysql-test/suite/parts/r/partition_debug_innodb.result
index d4ced5e6d6a..4d4538c168e 100644
--- a/mysql-test/suite/parts/r/partition_debug_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_innodb.result
@@ -961,25 +961,13 @@ SET @save_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_1";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1010,9 +998,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1061,25 +1061,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_2";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1110,9 +1098,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1161,25 +1161,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_3";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1210,9 +1198,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t2' to './test/#sql-exchange' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1261,25 +1261,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_4";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1310,9 +1298,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1361,25 +1361,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_5";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1410,9 +1398,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t1#P#p0' to './test/t2' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1461,25 +1461,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_6";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1510,9 +1498,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1561,25 +1561,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_7";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1610,9 +1598,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/#sql-exchange' to './test/t1#P#p0' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1661,25 +1661,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_8";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1710,9 +1698,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1761,25 +1761,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_9";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1810,9 +1798,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
diff --git a/mysql-test/suite/parts/t/alter_table.combinations b/mysql-test/suite/parts/t/alter_table.combinations
new file mode 100644
index 00000000000..d4feae10f19
--- /dev/null
+++ b/mysql-test/suite/parts/t/alter_table.combinations
@@ -0,0 +1,2 @@
+[range]
+[list]
diff --git a/mysql-test/suite/parts/t/alter_table.test b/mysql-test/suite/parts/t/alter_table.test
index 53b61806acb..741a9450c8e 100644
--- a/mysql-test/suite/parts/t/alter_table.test
+++ b/mysql-test/suite/parts/t/alter_table.test
@@ -1,9 +1,8 @@
-#
-# General errors with ALTER TABLE and partitions that doesn't have to be run
-# on all engines
-#
-
+# Permissions don't work with embedded
+--source include/not_embedded.inc
--source include/have_partition.inc
+--source include/lcase_names.inc
+--source suite/parts/inc/engines.inc
#
# MDEV-22649 SIGSEGV in ha_partition::create_partitioning_metadata on ALTER
@@ -38,3 +37,267 @@ CREATE TABLE t2 (i INT);
ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
DROP VIEW v1;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-22165 CONVERT PARTITION: move in partition from existing table
+--echo #
+create or replace table tp1 (a int);
+create or replace table t1 (a int)
+partition by hash (a) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert table tp1 to partition p2;
+
+create or replace table t1 (a int)
+partition by range (a)
+(partition p0 values less than (0));
+
+--error ER_NO_SUCH_TABLE
+alter table t1 convert table non_existent to partition p1 values less than (10);
+alter table t1 convert table tp1 to partition p1 values less than (10);
+--error ER_NO_SUCH_TABLE
+show create table tp1;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+create table tp2 (x int);
+--error ER_TABLES_DIFFERENT_METADATA
+alter table t1 convert table tp2 to partition p2 values less than (20);
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+create or replace table tp2 (a int);
+insert tp2 values (1), (15), (17);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (1), (17);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (17), (1);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+--error ER_NO_SUCH_TABLE
+show create table tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 partition (p2);
+
+create or replace table t1 (a int)
+partition by range (a) (
+p0 values less than (0),
+pn values less than (30));
+insert into t1 values (1);
+create or replace table tp1 (a int);
+insert into tp1 values (2);
+# TODO: would be good to automatically detect order of partitions,
+# as well as move the data from succeeding partitions (ADD PARTITION FR).
+--error ER_RANGE_NOT_INCREASING_ERROR
+alter table t1 convert table tp1 to partition p1 values less than (10);
+
+drop tables t1, tp1;
+
+
+--echo #
+--echo # MDEV-22166 CONVERT PARTITION: move out partition into a table
+--echo #
+
+create or replace table t1 (x int);
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by hash(x) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by key(x) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by range(x)
+subpartition by hash(x) subpartitions 3 (
+ partition p1 values less than (10),
+ partition pn values less than maxvalue);
+--error ER_PARTITION_CONVERT_SUBPARTITIONED
+alter table t1 convert partition p1 to table p1;
+--error ER_PARTITION_DOES_NOT_EXIST
+alter table t1 convert partition p1sp0 to table p1;
+
+create or replace table t1 (x int)
+partition by range(x) (
+ partition p1 values less than (10));
+--error ER_DROP_LAST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
+create or replace temporary table t1 (x int)
+partition by range(x) (
+ partition p0 values less than (10),
+ partition pn values less than maxvalue);
+
+if ($MTR_COMBINATION_RANGE)
+{
+ create or replace table t1 (x int)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+}
+
+if ($MTR_COMBINATION_LIST)
+{
+ create or replace table t1 (x int)
+ partition by list(x) (
+ partition p1 values in (2, 3, 4),
+ partition p2 values in (12, 13, 14),
+ partition p3 values in (22, 23, 24),
+ partition p4 values in (32, 33, 34),
+ partition p5 values in (42, 43, 44),
+ partition pn values in (52, 53, 54));
+}
+
+insert into t1 values (2), (12), (22), (32), (42), (52);
+
+create or replace table tp2 (y int);
+insert tp2 values (88);
+# Multiple ALTER PARTITION statements are not possible
+--error ER_PARSE_ERROR
+alter table t1 convert partition p2 to table tp2, drop partition p3;
+# TODO: probably no need in such specific codes, should be ER_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
+alter table t1 convert partition p00 to table tp00;
+# Better error here is ER_PARTITION_DOES_NOT_EXIST,
+# but mysql_alter_table() works checks new table before anything else.
+# So, looks like no big reason to change anything here.
+--error ER_TABLE_EXISTS_ERROR
+alter table t1 convert partition p00 to table tp2;
+--error ER_TABLE_EXISTS_ERROR
+alter table t1 convert partition p2 to table tp2;
+--delimiter $
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create trigger tr1 before update on t1 for each row
+begin
+ alter table t1 convert partition p2 to table tp2;
+end$
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function f1() returns int
+begin
+ alter table t1 convert partition p2 to table tp2;
+end$
+--delimiter ;
+select * from tp2;
+drop table tp2;
+alter table t1 convert partition p2 to table tp2;
+
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+select * from tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--error ER_BAD_DB_ERROR
+alter table t1 convert partition p3 to table inexistent.tp3;
+create database EXISTENT;
+alter table t1 convert partition p3 to table EXISTENT.TP3;
+
+# The only way to put `` into var...
+--let $tp3=`select '`TP3`'`
+if ($MTR_COMBINATION_LCASE1)
+{
+ --let $tp3= `select '`tp3`'`
+}
+--replace_result $engine X ' PAGE_CHECKSUM=1' '' $tp3 `TP3`-ok
+show create table EXISTENT.TP3;
+select * from EXISTENT.TP3 order by x;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--echo # LOCK TABLES
+lock tables t1 write;
+alter table t1 convert partition p4 to table tp4;
+# TODO: lock table tp4 in ALTER TABLE, otherwise there is no
+# guarantee in data consistency between t1 and tp4
+--error ER_TABLE_NOT_LOCKED
+show create table tp4;
+
+unlock tables;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp4;
+select * from tp4;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--echo # PS
+prepare stmt from 'alter table t1 convert partition p5 to table tp5';
+execute stmt;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp5;
+select * from tp5;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp5;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+drop prepare stmt;
+
+--echo # Privileges
+create user alan;
+grant usage on *.* to alan;
+grant create, insert, drop on test.* to alan;
+--connect alan,localhost,alan,,test
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant create, insert, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant create, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant insert, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+grant create, insert, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+alter table t1 convert partition p1 to table tp1;
+--disconnect alan
+--connection default
+
+drop database EXISTENT;
+drop user alan;
+drop tables t1, tp1, tp2, tp4;
diff --git a/mysql-test/suite/parts/t/engine_defined_part_attributes.test b/mysql-test/suite/parts/t/engine_defined_part_attributes.test
new file mode 100644
index 00000000000..1245066300c
--- /dev/null
+++ b/mysql-test/suite/parts/t/engine_defined_part_attributes.test
@@ -0,0 +1,221 @@
+--echo #
+--echo # MDEV-5271 Support engine-defined attributes per partition
+--echo #
+
+--source include/have_partition.inc
+--source include/have_innodb.inc
+
+--echo # partitioned tables
+
+CREATE TABLE `t1` (
+ `id` INT
+) ENGINE=InnoDB ENCRYPTED="YES" PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" ENCRYPTION_KEY_ID=1,
+ PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT" ENCRYPTION_KEY_ID=1
+);
+SHOW CREATE TABLE `t1`;
+
+INSERT INTO t1 VALUES (1), (2), (3);
+DELETE FROM t1 WHERE id = 1;
+UPDATE t1 SET id = 4 WHERE id = 3;
+SELECT * FROM t1 WHERE id IN (2, 3);
+
+DROP TABLE `t1`;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE `t2` (
+ `id` INT
+) ENGINE=InnoDB ENCRYPTED="YES" ENCRYPTION_KEY_ID=2 PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE `t3` (
+ `id` INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" ENCRYPTION_KEY_ID=2,
+ PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+
+CREATE TABLE `t4` (
+ `id` INT
+) ENGINE=InnoDB ENCRYPTED="NO";
+SHOW CREATE TABLE `t4`;
+
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO",
+ PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT"
+);
+SHOW CREATE TABLE `t4`;
+
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t4`;
+
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE `t4` PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" ENCRYPTION_KEY_ID=2,
+ PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="DEFAULT"
+);
+
+DROP TABLE `t4`;
+
+--echo # subpartitioned tables
+
+CREATE TABLE `t5` (
+ `id` INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id)
+SUBPARTITIONS 2 (
+ PARTITION pt1 VALUES LESS THAN (100),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t5`;
+
+DROP TABLE `t5`;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE `t6` (
+ `id` INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id)
+SUBPARTITIONS 2 (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES",
+ PARTITION pt2 VALUES LESS THAN MAXVALUE
+);
+
+--error ER_PARSE_ERROR
+CREATE TABLE `t7` (
+ id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+ PARTITION pt1 VALUES LESS THAN (100)(
+ SUBPARTITION spt1 ENCRYPTED="NO",
+ SUBPARTITION spt2
+ ),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE (
+ SUBPARTITION spt3,
+ SUBPARTITION spt4
+ )
+);
+
+CREATE TABLE `t8` (
+ id INT
+) ENGINE=InnoDB ENCRYPTED="NO" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+ PARTITION pt1 VALUES LESS THAN (100) (
+ SUBPARTITION spt1,
+ SUBPARTITION spt2
+ ),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE (
+ SUBPARTITION spt3,
+ SUBPARTITION spt4
+ )
+);
+SHOW CREATE TABLE `t8`;
+
+DROP TABLE `t8`;
+
+CREATE TABLE `t9` (
+ id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" (
+ SUBPARTITION spt1,
+ SUBPARTITION spt2
+ ),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE (
+ SUBPARTITION spt3,
+ SUBPARTITION spt4
+ )
+);
+SHOW CREATE TABLE `t9`;
+
+DROP TABLE `t9`;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE `t10` (
+ id INT
+) ENGINE=InnoDB PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="YES" (
+ SUBPARTITION spt1,
+ SUBPARTITION spt2
+ ),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE (
+ SUBPARTITION spt3,
+ SUBPARTITION spt4
+ )
+);
+
+CREATE TABLE `t11` (
+ id INT
+) ENGINE=InnoDB ENCRYPTED="YES" PARTITION BY RANGE(id)
+SUBPARTITION BY HASH(id) (
+ PARTITION pt1 VALUES LESS THAN (100) ENCRYPTED="NO" (
+ SUBPARTITION spt1,
+ SUBPARTITION spt2
+ ),
+ PARTITION pt2 VALUES LESS THAN MAXVALUE ENCRYPTED="NO" (
+ SUBPARTITION spt3,
+ SUBPARTITION spt4
+ )
+);
+SHOW CREATE TABLE `t11`;
+
+DROP TABLE `t11`;
+
+--echo #
+--echo # MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values
+--echo #
+
+--let $restart_parameters= --innodb-sys-tablespaces
+--source include/restart_mysqld.inc
+
+CREATE TABLE `t12` (
+ id INT
+) ENGINE=InnoDB PARTITION BY HASH(id)
+(
+ pt1 PAGE_COMPRESSED=0
+);
+--sorted_result
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+
+ALTER TABLE `t12` ADD PARTITION (
+ PARTITION pt2 PAGE_COMPRESSED=1
+);
+--sorted_result
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+
+ALTER TABLE `t12` ADD PARTITION (
+ PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3
+);
+--sorted_result
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
+
+DROP TABLE `t12`;
+
+CREATE TABLE `t13` (
+ `id` INT
+) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0,
+ PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
+ PARTITION pt3 VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE `t13`;
+--sorted_result
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
+
+ALTER TABLE `t13` PARTITION BY RANGE(id) (
+ PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
+ PARTITION pt2 VALUES LESS THAN (200),
+ PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0
+);
+SHOW CREATE TABLE `t13`;
+--sorted_result
+SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
+
+DROP TABLE `t13`;
diff --git a/mysql-test/suite/parts/t/partition_debug.test b/mysql-test/suite/parts/t/partition_debug.test
index 6d7cf3ae8b3..2f8994705f3 100644
--- a/mysql-test/suite/parts/t/partition_debug.test
+++ b/mysql-test/suite/parts/t/partition_debug.test
@@ -50,3 +50,114 @@ let $crash_statement= ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
--source suite/parts/inc/partition_crash_exchange.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_exchange.inc
+
+--echo #
+--echo # MDEV-22165 CONVERT PARTITION: move in partition from existing table
+--echo #
+let $create_statement= create or replace table t1 (x int primary key)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30));
+
+let $create_statement2= create or replace table t2 (x int primary key);
+let $insert_statement= insert into t1 values (2), (12), (22);
+let $insert_statement2= insert into t2 values (32), (42), (52);
+
+let $fail_statement= alter table t1 convert table t2 to partition pn values less than maxvalue;
+
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+
+
+--echo #
+--echo # MDEV-22166 CONVERT PARTITION: move out partition into a table
+--echo #
+let $create_statement= create or replace table t1 (x int primary key)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+
+let $insert_statement= insert into t1 values (2), (12), (22), (32), (42), (52);
+let $fail_statement= alter table t1 convert partition p2 to table tp2;
+
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_create_before_create_frm";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_alter_partition_after_write_frm";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,error_convert_partition_00";
+--source suite/parts/inc/partition_fail.inc
+#set session debug_dbug=@save_dbug;
+#set session debug_dbug="+d,fail_convert_partition_01";
+#--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+--echo # Already finished DDL logging, so tp2 now exists:
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+show create table tp2;
+select * from tp2;
+drop table tp2;
diff --git a/mysql-test/suite/perfschema/include/default_mysqld_autosize.cnf b/mysql-test/suite/perfschema/include/default_mysqld_autosize.cnf
index eee52ede869..6bcf7a09401 100644
--- a/mysql-test/suite/perfschema/include/default_mysqld_autosize.cnf
+++ b/mysql-test/suite/perfschema/include/default_mysqld_autosize.cnf
@@ -19,9 +19,8 @@ loose-innodb_buffer_pool_size= 8M
loose-innodb_lru_scan_depth= 100
loose-innodb_write_io_threads= 2
loose-innodb_read_io_threads= 2
-loose-innodb_log_buffer_size= 1M
-loose-innodb_log_file_size= 5M
-loose-innodb_log_files_in_group= 2
+loose-innodb_log_buffer_size= 2M
+loose-innodb_log_file_size= 10M
slave-net-timeout=120
diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result
index d3988f99727..a5996cc0083 100644
--- a/mysql-test/suite/perfschema/r/digest_view.result
+++ b/mysql-test/suite/perfschema/r/digest_view.result
@@ -191,17 +191,17 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 1
-test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
-test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
-test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 1
-test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 1
-test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 1
-test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 27a9ab161a63050c84a63c6f77ebeb33 EXPLAIN SELECT * FROM `test` . `v1` 1
+test ab0ab27c04f3a294feb86bede4331f86 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 2e722346a5c2ef820946bcd04ccac208 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test 07baf2264db30b6b25302603436ebe82 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
+test 3a7dbc963635ab0de6e160e0a4212bce EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
+test 6b845c2e3a7421997e3b610d14b5c842 SELECT * FROM `test` . `v1` 1
+test cb2ee099edbf6e0e5ee6ae14f3b1498a SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test e2dc5a300d2ba54ebb987a2ca6b90d93 SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test c68e0f99323f7bb7732c7b5cf32c0ec2 SELECT `a` , `b` FROM `test` . `v1` 1
+test 43c5de955c9a72d2bb6f49db5c0ad3e7 SELECT `b` , `a` FROM `test` . `v1` 1
+test 1678258ba15f7ccc63fd7b833763914a TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP TABLE test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
EXPLAIN SELECT * from test.v1;
@@ -248,19 +248,19 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test 630a0b16be33fcf549f4f467de557940 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
-test efa438aa8b4ddbf4c19f9e4b345781b5 DROP TABLE `test` . `v1` 1
-test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 2
-test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
-test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
-test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 2
-test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test a3788cc4bc96d260cfb5c3ebdfc65c6d SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
-test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 2
-test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 2
-test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 342cd5e41944d5f857f92b1e374857de CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
+test 2653f30030efcb6125121daa8eadf418 DROP TABLE `test` . `v1` 1
+test 27a9ab161a63050c84a63c6f77ebeb33 EXPLAIN SELECT * FROM `test` . `v1` 2
+test ab0ab27c04f3a294feb86bede4331f86 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 2e722346a5c2ef820946bcd04ccac208 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 07baf2264db30b6b25302603436ebe82 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
+test 3a7dbc963635ab0de6e160e0a4212bce EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
+test 6b845c2e3a7421997e3b610d14b5c842 SELECT * FROM `test` . `v1` 2
+test cb2ee099edbf6e0e5ee6ae14f3b1498a SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test e2dc5a300d2ba54ebb987a2ca6b90d93 SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test a13cfeda6d474d29546719d76dcfa831 SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
+test c68e0f99323f7bb7732c7b5cf32c0ec2 SELECT `a` , `b` FROM `test` . `v1` 2
+test 43c5de955c9a72d2bb6f49db5c0ad3e7 SELECT `b` , `a` FROM `test` . `v1` 2
+test 1678258ba15f7ccc63fd7b833763914a TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP VIEW test.v1;
DROP TABLE test.t1;
diff --git a/mysql-test/suite/perfschema/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result
index 5435efb34ae..f236f149a77 100644
--- a/mysql-test/suite/perfschema/r/max_program_zero.result
+++ b/mysql-test/suite/perfschema/r/max_program_zero.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 1
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index df9942a170f..2258cbceea4 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -174,3 +174,16 @@ select object_type, object_schema, object_name
from performance_schema.objects_summary_global_by_type
where object_schema="test";
object_type object_schema object_name
+#
+# MDEV-28344: sys.ps_setup_save and dependent procedures fail
+# with ER_ILLEGAL_HA_CREATE_OPTION
+#
+CREATE TEMPORARY TABLE t1 (t int) ENGINE = PERFORMANCE_SCHEMA;
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+CREATE TEMPORARY TABLE t1 LIKE performance_schema.setup_actors;
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+SET @default_storage_engine_old = @@default_storage_engine;
+SET default_storage_engine = performance_schema;
+CREATE TEMPORARY TABLE t1 (t int);
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+SET @@default_storage_engine = @default_storage_engine_old;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index 9489c1049e5..4224c3e520d 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -255,7 +255,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 94cc2b33b49..ab0d18e3227 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -57,7 +57,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index bfc49fd3480..fda05bf6df5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index e9f20398467..7db242f237f 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index ffb45f4f55f..31ddb4eb3cd 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
index e271d5a10e6..2a2d42f4d51 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 833da22583e..2115c747755 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index e3ff0f514a7..25b8a7b9c1f 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
index a2d84753331..13b51569b60 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
event_name digest digest_text sql_text
-statement/sql/select 70a97f8223477a66e716cfcc317193e2 SELECT ? + ? + SELECT ...
-statement/sql/truncate ac4c7fc23914b333e9f40ce317816b8e TRUNCATE TABLE truncat...
+statement/sql/select 1fd0cdb6b5aa22bd0809a39b2dc2ac70 SELECT ? + ? + SELECT ...
+statement/sql/truncate 0a9c405cebde6df4be315dae86ff398a TRUNCATE TABLE truncat...
diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result
index ffdf9d65b87..b34f86da89f 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_index.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
index dbb404f6129..e8bf9f48da8 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index f92b0e6bec6..021ff9f9e3d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index fefad55c209..0a7f1c601ef 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index 0c2f65f6ac9..de4ff2f5a72 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index c3f06b53425..997220d3169 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index fd39807d567..de81943afe8 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index 43111c5ec40..ce156302b22 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result
index 15d1184bcbe..d46095841c2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_index.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
index b8de90453ce..c1f7e656dc6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
index 60066264c90..94c8a7da85a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index 3353b46bbcb..e44307fdbe6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index d41da361733..6647def50c1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
index 4919de6bb6c..9b5ad931858 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index 02a119bdc68..fdd3fe48bf3 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index ead01ce2d0e..09faadaa4ce 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index a99f1c0f9be..2d93be52186 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index 7c148889412..e9eff67712f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index dec0680c511..f5b00a114dd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 0
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index 20adf1a9f64..d1b3e14d349 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 0
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 044f9475041..136c54885bf 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 0
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 350f2c6637d..3e2d7acf4ec 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index d2d7063c32f..5db6987834b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index 8bcb3c56a00..69a69986a72 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 2a2bf5d3f7c..2f68483cfae 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index ec6e40acc00..3d131f1a2e0 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 0
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index b3f1e4cbcf2..95f8f226c41 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
index baf9f761358..b54d6c762e1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index cd204f3d811..9182677d8b8 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index d083484cd7c..ff90c471599 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
index f5a12e5473d..4535bcd02ed 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
index 76ae9d5fa4e..f3eefb98a43 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index 4bd472a22a9..9ca79837845 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index f59b156ce1e..ee22d5b5bed 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index cc70572c7ef..adbad8d166f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index a53d591938c..022f7d1096e 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index e3ff0f514a7..25b8a7b9c1f 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_variables.result b/mysql-test/suite/perfschema/r/start_server_variables.result
index 7d1d1e05375..65d3a7b55b5 100644
--- a/mysql-test/suite/perfschema/r/start_server_variables.result
+++ b/mysql-test/suite/perfschema/r/start_server_variables.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
index 05ec7b0b2b5..264778c06e4 100644
--- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
+++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 2
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/sxlock_func.result b/mysql-test/suite/perfschema/r/sxlock_func.result
index ff556c1e011..d6bbce28ee1 100644
--- a/mysql-test/suite/perfschema/r/sxlock_func.result
+++ b/mysql-test/suite/perfschema/r/sxlock_func.result
@@ -10,6 +10,7 @@ name
wait/synch/rwlock/innodb/dict_operation_lock
wait/synch/rwlock/innodb/fil_space_latch
wait/synch/rwlock/innodb/lock_latch
+wait/synch/rwlock/innodb/log_latch
wait/synch/rwlock/innodb/trx_i_s_cache_lock
wait/synch/rwlock/innodb/trx_purge_latch
wait/synch/rwlock/innodb/trx_rseg_latch
@@ -43,6 +44,7 @@ ORDER BY event_name;
event_name
wait/synch/rwlock/innodb/fil_space_latch
wait/synch/rwlock/innodb/lock_latch
+wait/synch/rwlock/innodb/log_latch
SELECT event_name FROM performance_schema.events_waits_history_long
WHERE event_name = 'wait/synch/sxlock/innodb/index_tree_rw_lock'
AND operation IN ('try_shared_lock','shared_lock') LIMIT 1;
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index 848be3beea1..79c23c65616 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -298,3 +298,23 @@ drop tables t1;
select object_type, object_schema, object_name
from performance_schema.objects_summary_global_by_type
where object_schema="test";
+
+--echo #
+--echo # MDEV-28344: sys.ps_setup_save and dependent procedures fail
+--echo # with ER_ILLEGAL_HA_CREATE_OPTION
+--echo #
+
+# It is not allowed to create temporary tables with performance schema
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 (t int) ENGINE = PERFORMANCE_SCHEMA;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 LIKE performance_schema.setup_actors;
+
+SET @default_storage_engine_old = @@default_storage_engine;
+SET default_storage_engine = performance_schema;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 (t int);
+
+SET @@default_storage_engine = @default_storage_engine_old; \ No newline at end of file
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index 6769d867167..f5d1ce2497d 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -27,7 +27,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE AUTHENTICATION
PLUGIN_TYPE_VERSION 2.2
PLUGIN_LIBRARY auth_ed25519.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff
new file mode 100644
index 00000000000..06fdb0bd4f0
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lz4 compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lz4;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lz4, which is not currently loaded. Please load the lz4 provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff
new file mode 100644
index 00000000000..ee348934a54
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lzma compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzma;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzma
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lzma, which is not currently loaded. Please load the lzma provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff
new file mode 100644
index 00000000000..d7cdc41092a
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lzo compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzo;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzo
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lzo, which is not currently loaded. Please load the lzo provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff
new file mode 100644
index 00000000000..e9c7485d118
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing snappy compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = snappy;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-snappy
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with snappy, which is not currently loaded. Please load the snappy provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff
new file mode 100644
index 00000000000..9b155ff3a1d
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff
@@ -0,0 +1,40 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,12 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lz4 compression provider with mroonga
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
+-call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+-call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+-call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+-create table t1 (a int, b text ) engine = innodb page_compressed = 1;
++create table t1 (a int, b text COMMENT 'FLAGS "COLUMN_SCALAR|COMPRESS_LZ4"') engine = mroonga charset = utf8;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+ insert t1 (a, b) values (2, repeat("ghi", 10000));
+@@ -14,8 +11,20 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++a left(b, 9) length(b)
++0 0
++1 0
++2 0
++Warnings:
++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded
++select a, left(b, 9), length(b) from t1;
++a left(b, 9) length(b)
++0 0
++1 0
++2 0
++Warnings:
++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression.result b/mysql-test/suite/plugins/r/compression.result
new file mode 100644
index 00000000000..dd267f282c5
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression.result
@@ -0,0 +1,22 @@
+#
+# Testing bzip2 compression provider with innodb
+#
+call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+set global innodb_compression_algorithm = bzip2;
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# restart: --disable-provider-bzip2
+select a, left(b, 9), length(b) from t1;
+ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
+drop table t1;
+# restart
diff --git a/mysql-test/suite/plugins/r/compression_load.result b/mysql-test/suite/plugins/r/compression_load.result
new file mode 100644
index 00000000000..a23037edc17
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression_load.result
@@ -0,0 +1,33 @@
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+set global innodb_compression_algorithm = lz4;
+ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
+install plugin provider_lz4 soname 'provider_lz4';
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+provider_lz4 ACTIVE
+set global innodb_compression_algorithm = lz4;
+create table t1 (a int, b text) engine=innodb page_compressed=1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+uninstall plugin provider_lz4;
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+provider_lz4 INACTIVE
+set global innodb_compression_algorithm = default;
+set global innodb_compression_algorithm = lz4;
+set global innodb_compression_algorithm = default;
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+drop table t1;
diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result
index 218d12fb884..192d41d2ccf 100644
--- a/mysql-test/suite/plugins/r/cracklib_password_check.result
+++ b/mysql-test/suite/plugins/r/cracklib_password_check.result
@@ -4,9 +4,9 @@ PLUGIN_NAME cracklib_password_check
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
-PLUGIN_TYPE_VERSION 1.0
+PLUGIN_TYPE_VERSION 1.1
PLUGIN_LIBRARY cracklib_password_check.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Password validation via CrackLib
PLUGIN_LICENSE GPL
@@ -37,6 +37,18 @@ show warnings;
Level Code Message
Warning 1819 cracklib: it is based on a dictionary word
Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
+grant select on *.* to foocar@localhost identified by 'localhost';
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it is based upon your password entry
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
+grant select on *.* to foocar@localhost identified by 'foocar@localhost';
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
+show warnings;
+Level Code Message
+Warning 1819 cracklib: it is derived from your password entry
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foobar identified by 'q$%^&*rty';
drop user foobar;
#
diff --git a/mysql-test/suite/plugins/r/password_reuse_check.result b/mysql-test/suite/plugins/r/password_reuse_check.result
new file mode 100644
index 00000000000..72f3dd5364b
--- /dev/null
+++ b/mysql-test/suite/plugins/r/password_reuse_check.result
@@ -0,0 +1,94 @@
+install soname "password_reuse_check";
+set global password_reuse_check_interval= 0;
+# Default value (sould be unlimited i.e. 0)
+SHOW GLOBAL VARIABLES like "password_reuse_check%";
+Variable_name Value
+password_reuse_check_interval 0
+# insert user
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
+show warnings;
+Level Code Message
+Warning 1819 password_reuse_check: The password was already used
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
+alter user user_name@localhost identified by 'test_pwd';
+ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost'
+show warnings;
+Level Code Message
+Warning 1819 password_reuse_check: The password was already used
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
+Error 1396 Operation ALTER USER failed for 'user_name'@'localhost'
+# check exparation
+set global password_reuse_check_interval= 10;
+alter user user_name@localhost identified by 'test_pwd';
+ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost'
+show warnings;
+Level Code Message
+Warning 1819 password_reuse_check: The password was already used
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
+Error 1396 Operation ALTER USER failed for 'user_name'@'localhost'
+select hex(hash) from mysql.password_reuse_check_history;
+hex(hash)
+B9F970DE4DA0145F842526C1BC9DBBBDB3EF80FDD7BE98061DAE3D18F492AA37668C07322DD21650C66B48FC78F0EAF6CB08245CC895BFDC43BE6921B07E5240
+# emulate old password
+update mysql.password_reuse_check_history set time= date_sub(now(), interval
+11 day);
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+Level Code Message
+drop user user_name@localhost;
+show create table mysql.password_reuse_check_history;
+Table Create Table
+password_reuse_check_history CREATE TABLE `password_reuse_check_history` (
+ `hash` binary(64) NOT NULL,
+ `time` timestamp NOT NULL DEFAULT current_timestamp(),
+ PRIMARY KEY (`hash`),
+ KEY `tm` (`time`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+select count(*) from mysql.password_reuse_check_history;
+count(*)
+1
+drop table mysql.password_reuse_check_history;
+# test error messages
+set global password_reuse_check_interval= 0;
+drop table if exists mysql.password_reuse_check_history;
+Warnings:
+Note 1051 Unknown table 'mysql.password_reuse_check_history'
+# test error messages
+create table mysql.password_reuse_check_history (wrong_structure int);
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
+show warnings;
+Level Code Message
+Warning 1105 password_reuse_check:[1054] Unknown column 'hash' in 'field list'
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
+set global password_reuse_check_interval= 10;
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
+show warnings;
+Level Code Message
+Warning 1105 password_reuse_check:[1054] Unknown column 'time' in 'where clause'
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
+drop table mysql.password_reuse_check_history;
+#
+# MDEV-28838: password_reuse_check plugin mixes username and password
+#
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+grant select on *.* to user_nam@localhost identified by 'etest_pwd';
+show warnings;
+Level Code Message
+drop user user_name@localhost;
+drop user user_nam@localhost;
+drop table mysql.password_reuse_check_history;
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+grant select on *.* to tuser_name@localhos identified by 'test_pwd';
+show warnings;
+Level Code Message
+drop user user_name@localhost;
+drop user tuser_name@localhos;
+#
+# End of 10.7 tests
+#
+drop table mysql.password_reuse_check_history;
+uninstall plugin password_reuse_check;
diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result
index 3bdaf39d0d0..ebd5b6cc198 100644
--- a/mysql-test/suite/plugins/r/show_all_plugins.result
+++ b/mysql-test/suite/plugins/r/show_all_plugins.result
@@ -4,8 +4,8 @@ Variable_name Value
Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
-EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.14 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
-UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.14 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
+EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.15 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
+UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.15 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1
diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result
index ab6988ed002..30f68ba8193 100644
--- a/mysql-test/suite/plugins/r/simple_password_check.result
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -4,9 +4,9 @@ PLUGIN_NAME simple_password_check
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
-PLUGIN_TYPE_VERSION 1.0
+PLUGIN_TYPE_VERSION 1.1
PLUGIN_LIBRARY simple_password_check.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Simple password strength checks
PLUGIN_LICENSE GPL
diff --git a/mysql-test/suite/plugins/r/test_sql_service.result b/mysql-test/suite/plugins/r/test_sql_service.result
index af414d6c6e7..e5f09b67b6b 100644
--- a/mysql-test/suite/plugins/r/test_sql_service.result
+++ b/mysql-test/suite/plugins/r/test_sql_service.result
@@ -1,8 +1,100 @@
+reset master;
install plugin test_sql_service soname 'test_sql_service';
+show status like 'test_sql_service_passed';
+Variable_name Value
+Test_sql_service_passed 1
+set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null';
+set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null';
+select * from t1 order by a;
+a @@SQL_LOG_BIN
+1 0
+2 0
+3 1
+4 0
+5 1
+6 0
+drop table t1;
+SET SQL_LOG_BIN=0;
set global test_sql_service_run_test= 1;
-show status like 'test_sql_service%';
+show status like 'test_sql_service_passed';
+Variable_name Value
+Test_sql_service_passed 1
+set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 2 rows.
+set global test_sql_service_execute_sql_local= 'select * from test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 2 rows.
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
+set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 2 rows.
+set global test_sql_service_execute_sql_global= 'select * from test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 2 rows.
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
+create table t1 (id int, time timestamp);
+insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL);
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 0 rows.
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 5 rows.
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 0 rows.
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
Variable_name Value
-Test_sql_service_passed 0
+Test_sql_query_result Query returned 5 rows.
+drop table t1;
uninstall plugin test_sql_service;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # insert into test.t1 select 3 as a, @@SQL_LOG_BIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-test/suite/plugins/t/compression.combinations b/mysql-test/suite/plugins/t/compression.combinations
new file mode 100644
index 00000000000..645ca60e5f0
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression.combinations
@@ -0,0 +1,29 @@
+[innodb-bzip2]
+innodb
+plugin-load-add=$PROVIDER_BZIP2_SO
+loose-provider-bzip2
+
+[innodb-lz4]
+innodb
+plugin-load-add=$PROVIDER_LZ4_SO
+loose-provider-lz4
+
+[innodb-lzma]
+innodb
+plugin-load-add=$PROVIDER_LZMA_SO
+loose-provider-lzma
+
+[innodb-lzo]
+innodb
+plugin-load-add=$PROVIDER_LZO_SO
+loose-provider-lzo
+
+[innodb-snappy]
+innodb
+plugin-load-add=$PROVIDER_SNAPPY_SO
+loose-provider-snappy
+
+[mroonga-lz4]
+plugin-load-add=$HA_MROONGA_SO
+plugin-load-add=$PROVIDER_LZ4_SO
+loose-provider-lz4
diff --git a/mysql-test/suite/plugins/t/compression.test b/mysql-test/suite/plugins/t/compression.test
new file mode 100644
index 00000000000..c97c5725e1d
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression.test
@@ -0,0 +1,52 @@
+let $engine=`select regexp_replace('$MTR_COMBINATIONS', '-.*', '')`;
+let $alg=`select regexp_replace('$MTR_COMBINATIONS', '.*-', '')`;
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = '$engine' and plugin_status='active'`)
+{
+ skip Needs $engine engine;
+}
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip Needs provider_$alg plugin;
+}
+
+--echo #
+--echo # Testing $alg compression provider with $engine
+--echo #
+
+call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+if ($engine == "innodb") {
+ eval set global innodb_compression_algorithm = $alg;
+ let $table_params = page_compressed = 1;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+}
+if ($engine == "mroonga") {
+ let $column_params = `select upper('COMMENT \'flags "COLUMN_SCALAR|COMPRESS_$alg"\'')`;
+ let $table_params = charset = utf8;
+}
+
+eval create table t1 (a int, b text $column_params) engine = $engine $table_params;
+
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+let $restart_parameters = --disable-provider-$alg;
+source include/restart_mysqld.inc;
+
+if ($engine == "innodb") {
+ error ER_PROVIDER_NOT_LOADED;
+ select a, left(b, 9), length(b) from t1;
+}
+if ($engine == "mroonga"){
+ select a, left(b, 9), length(b) from t1;
+ select a, left(b, 9), length(b) from t1; # a warning once per statement
+}
+drop table t1;
+
+let $restart_parameters =;
+source include/restart_mysqld.inc;
diff --git a/mysql-test/suite/plugins/t/compression_load.test b/mysql-test/suite/plugins/t/compression_load.test
new file mode 100644
index 00000000000..d67c204e75f
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression_load.test
@@ -0,0 +1,24 @@
+source include/have_innodb.inc;
+
+if (!$PROVIDER_LZ4_SO) {
+ skip Requires provider_lz4 plugin;
+}
+
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_compression_algorithm = lz4;
+install plugin provider_lz4 soname 'provider_lz4';
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+set global innodb_compression_algorithm = lz4;
+create table t1 (a int, b text) engine=innodb page_compressed=1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+uninstall plugin provider_lz4;
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+set global innodb_compression_algorithm = default;
+set global innodb_compression_algorithm = lz4;
+set global innodb_compression_algorithm = default;
+select a, left(b, 9), length(b) from t1;
+drop table t1;
diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test
index 89b53b656d6..0fbef757e30 100644
--- a/mysql-test/suite/plugins/t/cracklib_password_check.test
+++ b/mysql-test/suite/plugins/t/cracklib_password_check.test
@@ -27,6 +27,14 @@ show warnings;
grant select on *.* to foobar identified by 'qwerty';
show warnings;
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar@localhost identified by 'localhost';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar@localhost identified by 'foocar@localhost';
+show warnings;
+
grant select on *.* to foobar identified by 'q$%^&*rty';
drop user foobar;
diff --git a/mysql-test/suite/plugins/t/password_reuse_check.test b/mysql-test/suite/plugins/t/password_reuse_check.test
new file mode 100644
index 00000000000..16ff21dc454
--- /dev/null
+++ b/mysql-test/suite/plugins/t/password_reuse_check.test
@@ -0,0 +1,100 @@
+--source include/not_embedded.inc
+
+if (!$PASSWORD_REUSE_CHECK_SO) {
+ skip No PASSWORD_REUSE_CHECK plugin;
+}
+
+install soname "password_reuse_check";
+
+set global password_reuse_check_interval= 0;
+
+--echo # Default value (sould be unlimited i.e. 0)
+SHOW GLOBAL VARIABLES like "password_reuse_check%";
+
+--echo # insert user
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+--error ER_CANNOT_USER
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+
+# Plugin does not work for it
+#--error ER_NOT_VALID_PASSWORD
+#SET PASSWORD FOR user_name@localhost = PASSWORD('test_pwd');
+
+--echo # check exparation
+
+set global password_reuse_check_interval= 10;
+
+--error ER_CANNOT_USER
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+select hex(hash) from mysql.password_reuse_check_history;
+
+--echo # emulate old password
+update mysql.password_reuse_check_history set time= date_sub(now(), interval
+11 day);
+
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+
+drop user user_name@localhost;
+
+show create table mysql.password_reuse_check_history;
+select count(*) from mysql.password_reuse_check_history;
+
+drop table mysql.password_reuse_check_history;
+
+--echo # test error messages
+
+set global password_reuse_check_interval= 0;
+
+drop table if exists mysql.password_reuse_check_history;
+
+--echo # test error messages
+
+create table mysql.password_reuse_check_history (wrong_structure int);
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+set global password_reuse_check_interval= 10;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+drop table mysql.password_reuse_check_history;
+
+--echo #
+--echo # MDEV-28838: password_reuse_check plugin mixes username and password
+--echo #
+
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+
+grant select on *.* to user_nam@localhost identified by 'etest_pwd';
+show warnings;
+
+drop user user_name@localhost;
+drop user user_nam@localhost;
+drop table mysql.password_reuse_check_history;
+
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+
+grant select on *.* to tuser_name@localhos identified by 'test_pwd';
+show warnings;
+
+drop user user_name@localhost;
+drop user tuser_name@localhos;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
+
+drop table mysql.password_reuse_check_history;
+uninstall plugin password_reuse_check;
diff --git a/mysql-test/suite/plugins/t/test_sql_service.test b/mysql-test/suite/plugins/t/test_sql_service.test
index 9b9e29c6913..0a45cb663f4 100644
--- a/mysql-test/suite/plugins/t/test_sql_service.test
+++ b/mysql-test/suite/plugins/t/test_sql_service.test
@@ -1,4 +1,7 @@
--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+reset master; # clear binlogs
if (!$TEST_SQL_SERVICE_SO) {
skip No TEST_SQL_SERVICE plugin;
@@ -9,9 +12,72 @@ let count_sessions= 1;
source include/wait_until_count_sessions.inc;
install plugin test_sql_service soname 'test_sql_service';
+show status like 'test_sql_service_passed';
+
+set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN';
+set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null';
+set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0';
+set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null';
+select * from t1 order by a;
+drop table t1;
+SET SQL_LOG_BIN=0;
set global test_sql_service_run_test= 1;
-show status like 'test_sql_service%';
+show status like 'test_sql_service_passed';
+
+set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'select * from test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'select * from test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+create table t1 (id int, time timestamp);
+insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL);
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+drop table t1;
uninstall plugin test_sql_service;
+# Check that statements were executed/binlogged in correct order.
+source include/show_binlog_events.inc;
+# --replace_column 2 # 5 #
+# --replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
+# SHOW BINLOG EVENTS LIMIT 3,100;
+
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 249fb8198a7..8b5e36d8b3c 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -321,7 +321,9 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1,10,100),(2,20,200);
+INSERT INTO `t1` VALUES
+(1,10,100),
+(2,20,200);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
@@ -330,7 +332,8 @@ CREATE TABLE `t2` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t2` VALUES (2,20,200);
+INSERT INTO `t2` VALUES
+(2,20,200);
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_master.test b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
index 02645a577f5..0d397b7e3ba 100644
--- a/mysql-test/suite/rpl/include/rpl_extra_col_master.test
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
@@ -825,7 +825,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo *****************
--echo
connection slave;
-# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
+# 1072 = ER_KEY_COLUMN_DOES_NOT_EXIST
--let $slave_sql_errno= 1072
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index bb1a2c173de..e9e1fd512b4 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -29,7 +29,7 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
--echo
--echo ******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
-DELETE FROM t2 WHERE b <> UUID();
+DELETE FROM t2 WHERE b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -37,7 +37,7 @@ DELETE FROM t2 WHERE b <> UUID();
--echo
--echo ******************** INSERT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-INSERT INTO t1 VALUES(2, UUID());
+INSERT INTO t1 VALUES(2, SYS_GUID());
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
@@ -60,7 +60,7 @@ INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t1 VALUES(3, 't1, text 3');
REPLACE INTO t1 VALUES(1, 't1, text 11');
-REPLACE INTO t1 VALUES(2, UUID());
+REPLACE INTO t1 VALUES(2, SYS_GUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_select.inc
@@ -70,7 +70,7 @@ DELETE FROM t1 WHERE a = 2;
--echo
--echo ******************** SELECT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-SELECT * FROM t1 WHERE b <> UUID() ORDER BY a;
+SELECT * FROM t1 WHERE b <> SYS_GUID() ORDER BY a;
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# JOIN
@@ -89,7 +89,7 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a;
--echo ******************** UNION ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
-SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> UUID();
+SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# TRUNCATE
@@ -144,7 +144,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
INSERT INTO t1 VALUES (6, 'after savepoint s2');
-INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
+INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
@@ -257,7 +257,7 @@ BEGIN
END|
CREATE PROCEDURE p2 ()
BEGIN
- UPDATE t1 SET b = UUID() WHERE a = 202;
+ UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END|
DELIMITER ;|
INSERT INTO t1 VALUES(201, 'test 201');
@@ -309,7 +309,7 @@ DROP EVENT e2;
INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
-CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
+CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_check_view.inc
ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_view.inc
@@ -323,7 +323,7 @@ DROP VIEW v2;
--echo ******************** SHOW BINLOG EVENTS ********************
--source include/show_binlog_events.inc
sync_slave_with_master;
-# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
+# as we're using SYS_GUID we don't SELECT but use "diff" like in rpl_row_SYS_GUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
index 31b80732c60..d814a257711 100644
--- a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
+++ b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
@@ -10,7 +10,7 @@
# - Master is switching explicitly between STATEMENT, ROW, and MIXED
# binlog format showing when it is possible and when not.
# - Master switching from MIXED to RBR implicitly listing all use
-# cases, e.g a query invokes UUID(), thereafter to serve as the
+# cases, e.g a query invokes SYS_GUID(), thereafter to serve as the
# definition of MIXED binlog format
# - correctness of execution
@@ -56,18 +56,18 @@ select @@global.binlog_format, @@session.binlog_format;
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
# verify that temp tables prevent a switch to SBR
@@ -129,41 +129,41 @@ select @@global.binlog_format, @@session.binlog_format;
set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
# Test of CREATE TABLE SELECT
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
--enable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
-# what if UUID() is first:
+# what if SYS_GUID() is first:
--disable_warnings
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
--enable_warnings
# inside a stored procedure
@@ -172,14 +172,14 @@ delimiter |;
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -199,7 +199,7 @@ delimiter ;|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
# test that can't SET in a stored function
@@ -249,7 +249,7 @@ deallocate prepare stmt1;
delimiter |;
create function foo5() returns bigint unsigned
begin
- insert into t2 select UUID();
+ insert into t2 select SYS_GUID();
return 100;
end|
delimiter ;|
@@ -260,7 +260,7 @@ execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# A simple stored function where UUID() is in the argument
+# A simple stored function where SYS_GUID() is in the argument
delimiter |;
create function foo6(x varchar(100)) returns bigint unsigned
begin
@@ -269,17 +269,17 @@ begin
end|
delimiter ;|
select foo6("foo6_1_");
-select foo6(concat("foo6_2_",UUID()));
+select foo6(concat("foo6_2_",SYS_GUID()));
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# Test of views using UUID()
+# Test of views using SYS_GUID()
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
# Test of querying INFORMATION_SCHEMA which parses the view's body,
@@ -291,18 +291,18 @@ execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# Test of triggers with UUID()
+# Test of triggers with SYS_GUID()
delimiter |;
create trigger t11_bi before insert on t11 for each row
begin
- set NEW.data = concat(NEW.data,UUID());
+ set NEW.data = concat(NEW.data,SYS_GUID());
end|
delimiter ;|
insert into t11 values("try_560_");
# Test that INSERT DELAYED works in mixed mode (BUG#20649)
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
@@ -482,7 +482,7 @@ sync_slave_with_master;
# Test for BUG#20499 "mixed mode with temporary table breaks binlog"
# Slave used to have only 2 rows instead of 3.
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
# we'll verify that this one is done RBB
@@ -546,7 +546,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
sync_slave_with_master;
@@ -587,7 +587,7 @@ INSERT INTO t13 VALUES (my_current_user());
sync_slave_with_master;
-# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
+# as we're using SYS_GUID we don't SELECT but use "diff" like in rpl_row_UUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/include/start_alter_basic.inc b/mysql-test/suite/rpl/include/start_alter_basic.inc
new file mode 100644
index 00000000000..f6e4b6b3253
--- /dev/null
+++ b/mysql-test/suite/rpl/include/start_alter_basic.inc
@@ -0,0 +1,60 @@
+#
+# Run start alter basic tests (CA/RA with given engine)
+# Params:-
+# $engine
+# $sync_slave
+# master_node and slave_node connection should be defined
+
+--echo # $engine
+--connection master_node
+--eval create table t1(a int, b int) engine=$engine;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+--echo # Normal Alter
+alter table t1 add column c int;
+show create table t1;
+--echo # Failed Alter
+insert into t1 values(1,1, NULL);
+--error ER_DUP_ENTRY
+alter table t1 change a a int unique;
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+
+# The following restriction should be removed post MDEV-26005 fix.
+# TODO MDEV-26130 , should be removed after fixing
+#if ($engine != 'aria')
+#{
+#--eval create temporary table tmp_tbl(a int, b int) engine=$engine;
+#insert into tmp_tbl values(1,1);
+#insert into tmp_tbl values(2,2);
+#--echo # Normal Alter
+#alter table tmp_tbl add column c int;
+#--echo # Failed Alter
+#insert into tmp_tbl values(1,1, NULL);
+#--error ER_DUP_ENTRY
+#alter table tmp_tbl change a a int unique ;
+#show create table tmp_tbl;
+#}
+if ($sync_slave)
+{
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ show create table t1;
+}
+
+--connection master_node
+drop table t1;
+#if ($engine != 'aria')
+#{
+#drop temporary table tmp_tbl;
+#}
+if ($sync_slave)
+{
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+}
diff --git a/mysql-test/suite/rpl/include/start_alter_concurrent.inc b/mysql-test/suite/rpl/include/start_alter_concurrent.inc
new file mode 100644
index 00000000000..e5472152807
--- /dev/null
+++ b/mysql-test/suite/rpl/include/start_alter_concurrent.inc
@@ -0,0 +1,230 @@
+#
+# ==== Purpose ====
+#
+# Run concurrent split alter on given storage engine
+# With concurrent 10 connections
+#
+# ==== Usage ====
+#
+# --let $alter_engine= Engine Name (myisam , innodb ...)
+# --let $alter_algorithm= ...
+# --let $alter_online = [][ONLINE]
+# --let $domain_1=
+# --let $domain_2=
+# --let $M_port= //Master port
+# --let $S_port= //Slave port
+# --let $sync_slave= // 0/1 whether to sync slave with master or not
+#
+
+
+--connection master_node
+set global debug_dbug="+d,start_alter_delay_master";
+
+--let $i= 1
+while($i < 11)
+{
+ if($i == 1 && $domain_1)
+ {
+ --eval set gtid_domain_id= $domain_1;
+ }
+ if($i == 6 && $domain_2)
+ {
+ --eval set gtid_domain_id= $domain_2;
+ }
+ --eval create table t$i( a int primary key, b int) engine=$alter_engine
+ --eval insert into t$i values(1,1),(2,2)
+ --inc $i
+}
+
+
+if ($sync_slave)
+{
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+}
+
+--let $i= 1
+while($i < 21)
+{
+ if($i == 1 || $i == 11)
+ {
+ if($domain_1)
+ {
+ --eval set global gtid_domain_id= $domain_1;
+ }
+ }
+ if($i == 6 || $i == 16)
+ {
+ if($domain_2)
+ {
+ --eval set global gtid_domain_id= $domain_2;
+ }
+ }
+ connect(con$i,127.0.0.1,root,,$db_name, $M_port);
+ --inc $i
+}
+
+--let $i= 1
+while($i < 11)
+{
+ --connection con$i
+ --send_eval alter $alter_online table t$i add column c int, force, algorithm=$alter_algorithm
+ --inc $i
+}
+
+--connection master_node
+set DEBUG_SYNC= "now signal alter_cont";
+
+--let $i= 1
+while($i < 11)
+{
+ --connection con$i
+ --reap
+ --inc $i
+}
+--connection master_node
+set DEBUG_SYNC= 'RESET';
+
+if ($sync_slave)
+{
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+}
+
+
+--echo # Concurrent DML
+--let $i= 1
+while($i < 11)
+{
+ --connection con$i
+ --send_eval alter table t$i add column d int, force, algorithm=$alter_algorithm
+ --inc $i
+}
+
+if ($alter_algorithm == "inplace")
+{
+ --sleep 1
+ --let $i= 11
+ --let $j= 1
+ while($i < 21)
+ {
+ --connection con$i
+ --send_eval insert into t$j values(5,5,5);
+ --inc $i
+ --inc $j
+ }
+
+ --let $i= 11
+ while($i < 21)
+ {
+ --connection con$i
+ --reap
+ --inc $i
+ }
+
+ if ($sync_slave)
+ {
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+ }
+}
+--connection master_node
+set DEBUG_SYNC= "now signal alter_cont";
+--let $i= 1
+while($i < 11)
+{
+ --connection con$i
+ --reap
+ --inc $i
+}
+--connection master_node
+set DEBUG_SYNC= 'RESET';
+
+if ($sync_slave)
+{
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+}
+
+
+--echo # Rollback tests
+--let $i= 1
+while($i < 11)
+{
+ --connection con$i
+ --eval insert into t$i values(3,2,1,1)
+ --send_eval alter table t$i change b b int unique, force, algorithm=$alter_algorithm
+ --inc $i
+}
+--connection master_node
+set DEBUG_SYNC= "now signal alter_cont";
+
+
+--let $i= 1
+while ($i < 11)
+{
+ --connection con$i
+ --error ER_DUP_ENTRY
+ --reap
+ --inc $i
+}
+--connection master_node
+set DEBUG_SYNC= 'RESET';
+
+
+if ($sync_slave)
+{
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+}
+
+if ($sync_slave)
+{
+ --enable_query_log
+ --echo # diff_table of master and slave , we will do only in the case when
+ --echo # sync_slave is on
+ --let $i= 1
+ while($i < 11)
+ {
+ --let $diff_tables= master_node:t$i, slave_node:t$i
+ source include/diff_tables.inc;
+ --inc $i
+ }
+ --disable_query_log
+}
+
+--connection master_node
+drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+
+if ($sync_slave)
+{
+ --echo # Sync slave
+ --source include/save_master_gtid.inc
+ --connection slave_node
+ --source include/sync_with_master_gtid.inc
+ --connection master_node
+}
+
+--let $i= 1
+while ($i < 21)
+{
+ --disconnect con$i
+ --inc $i
+}
+--connection master_node
+SET GLOBAL debug_dbug= "";
diff --git a/mysql-test/suite/rpl/include/start_alter_include.inc b/mysql-test/suite/rpl/include/start_alter_include.inc
new file mode 100644
index 00000000000..c66075c0164
--- /dev/null
+++ b/mysql-test/suite/rpl/include/start_alter_include.inc
@@ -0,0 +1,64 @@
+#
+# ==== Purpose ====
+#
+# Run concurrent split alter on different storage engine and with sync to given
+# master
+#
+# ==== Usage ====
+# --let $domain_1=
+# --let $domain_2=
+# --let $M_port= //Master port
+# --let $S_port= //Slave port
+# --let $sync_slave=
+# --let $db_name=
+#
+
+connect(master_node,127.0.0.1,root,,$db_name, $M_port);
+if (!$sync_slave)
+{
+ --eval set gtid_domain_id= $domain_1;
+}
+connect(slave_node,127.0.0.1,root,,test, $S_port);
+if (!$sync_slave)
+{
+ --eval set gtid_domain_id= $domain_2;
+}
+
+--let $engine=myisam
+--source include/start_alter_basic.inc
+
+--let $engine=innodb
+--source include/start_alter_basic.inc
+
+--let $engine=aria
+--source include/start_alter_basic.inc
+
+--disable_query_log
+--disable_warnings
+--connection master_node
+--echo # concurrent alter Myisam
+--let $alter_engine=myisam
+--let $alter_algorithm=copy
+--source include/start_alter_concurrent.inc
+
+--connection master_node
+--echo # concurrent alter Aria
+--let $alter_engine=aria
+--let $alter_algorithm=copy
+--source include/start_alter_concurrent.inc
+
+--connection master_node
+--echo # concurrent alter Innodb copy
+--let $alter_engine=innodb
+--let $alter_algorithm=copy
+--source include/start_alter_concurrent.inc
+
+--connection master_node
+--echo # concurrent alter Innodb Inplace
+--let $alter_engine=innodb
+--let $alter_algorithm=inplace
+--source include/start_alter_concurrent.inc
+--disconnect master_node
+--disconnect slave_node
+--enable_warnings
+--enable_query_log
diff --git a/mysql-test/suite/rpl/include/start_alter_options.inc b/mysql-test/suite/rpl/include/start_alter_options.inc
new file mode 100644
index 00000000000..72c7104b114
--- /dev/null
+++ b/mysql-test/suite/rpl/include/start_alter_options.inc
@@ -0,0 +1,399 @@
+# This test will test all the option related to the Alter Table command
+# NOTE not all alter statements will follow alter_algorithm since for some statements
+# copy is only option
+# parameters
+# $alter_algorithm {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}
+# $show_binlog
+#
+--let $force_needed= force ,
+# Error that is caused by a particular ALTER's option combination
+--let $alter_error = 0
+
+--connection slave
+stop slave;
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+--connection master
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+
+# These are grammer rules for ALTER TABLE we will got through all alter table
+# rules in this test.
+# | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition
+# [FIRST | AFTER col_name ]
+# | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition,...)
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column if not exists c int , $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column d int first, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 add column e int after c, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 add column f int after c, $force_needed add column g int first ,add column h char, algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, $force_needed algorithm=$alter_algorithm
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column if not exists c int , $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl add column d int first, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl add column e int after c, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl add column f int after c, $force_needed add column g int first ,add column h char, algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, $force_needed algorithm=$alter_algorithm
+}
+--echo # show binlog and clear status
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+
+#
+# | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]
+# [index_type] (index_col_name,...) [index_option] ...
+# | ADD [CONSTRAINT [symbol]]
+# UNIQUE [INDEX|KEY] [index_name]
+# [index_type] (index_col_name,...) [index_option] ...
+#
+# | ADD FULLTEXT [INDEX|KEY] [index_name]
+# (index_col_name,...) [index_option] ...
+# | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]
+# | DROP PRIMARY KEY
+# | DROP {INDEX|KEY} [IF EXISTS] index_name
+# | DROP FOREIGN KEY [IF EXISTS] fk_symbol
+# | DROP CONSTRAINT [IF EXISTS] constraint_name
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column f int after b, $force_needed add column g int first ,add column h varchar(100), algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table t1 add index if not exists index_1(f), $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop index index_1, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table t1 add unique key unique_1(g), $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop index unique_1, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table t1 add fulltext key f_1(h), $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column f, drop column g , $force_needed algorithm=$alter_algorithm
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column f int after b, $force_needed add column g int first ,add column h varchar(100), algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table tmp_tbl add index if not exists index_1(f), $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop index index_1, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl add unique key unique_1(g), $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop index unique_1, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop column f, drop column g , $force_needed algorithm=$alter_algorithm
+}
+# | ADD [CONSTRAINT [symbol]] PRIMARY KEY
+# [index_type] (index_col_name,...) [index_option] ...
+# primary key changes cant use inplace algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table t1 add primary key(h), $force_needed algorithm=copy
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop primary key, $force_needed algorithm=copy
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column h, $force_needed algorithm=copy
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add primary key(h), $force_needed algorithm=copy
+--eval alter table tmp_tbl drop primary key, $force_needed algorithm=copy
+--eval alter table tmp_tbl drop column h, $force_needed algorithm=copy
+}
+--echo # show binlog and clear status
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+## NOTE force_needed and algorithm will not be used for system versioning
+# | ADD PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)
+# | ADD SYSTEM VERSIONING
+# | DROP SYSTEM VERSIONING
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+--eval alter table t1 add period for system_time(f,h)
+--eval alter table t1 add system versioning
+--eval alter table t1 drop system versioning
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column f, drop column g , drop column h, $force_needed algorithm=$alter_algorithm
+--echo # show binlog and clear status
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column f varchar(100) after b, add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop column f, drop column g , drop column h, $force_needed algorithm=$alter_algorithm
+}
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+
+# | ALTER [COLUMN] col_name SET DEFAULT literal | (expression)
+# | ALTER [COLUMN] col_name DROP DEFAULT
+# | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name column_definition
+# [FIRST|AFTER col_name]
+# | MODIFY [COLUMN] [IF EXISTS] col_name column_definition
+# [FIRST | AFTER col_name]
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm ;
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 alter column f set default "****", $force_needed algorithm=$alter_algorithm ;
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 alter column f drop default, $force_needed algorithm=$alter_algorithm ;
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 change column g new_g char, $force_needed algorithm=copy;
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 modify column h varchar(100), $force_needed algorithm=copy;
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column new_g ,drop column f, drop column h, $force_needed algorithm=$alter_algorithm ;
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm ;
+--eval alter table tmp_tbl alter column f set default "****", $force_needed algorithm=$alter_algorithm ;
+--eval alter table tmp_tbl alter column f drop default, $force_needed algorithm=$alter_algorithm ;
+--eval alter table tmp_tbl change column g new_g char, $force_needed algorithm=copy;
+--eval alter table tmp_tbl modify column h varchar(100), $force_needed algorithm=copy;
+--eval alter table tmp_tbl drop column new_g ,drop column f, drop column h, $force_needed algorithm=$alter_algorithm ;
+}
+--echo # show binlog and clear status
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+# | DISABLE KEYS
+# | ENABLE KEYS
+# | RENAME [TO] new_tbl_name
+# | ORDER BY col_name [, col_name] ...
+# | RENAME COLUMN old_col_name TO new_col_name
+# | RENAME {INDEX|KEY} old_index_name TO new_index_name
+# | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
+# | [DEFAULT] CHARACTER SET [=] charset_name
+# | [DEFAULT] COLLATE [=] collation_name
+# | DISCARD TABLESPACE
+# | IMPORT TABLESPACE
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_KEY_COLUMN_DOES_NOT_EXIST
+}
+--error 0,$alter_error
+--eval alter table t1 add index if not exists index_1(f), $force_needed algorithm=$alter_algorithm
+--eval alter table t1 disable keys, $force_needed algorithm=copy
+--eval alter table t1 enable keys, $force_needed algorithm=copy
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 rename t2, $force_needed algorithm=$alter_algorithm
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_NO_SUCH_TABLE
+}
+--error 0,$alter_error
+--eval alter table t2 rename t1, $force_needed algorithm=$alter_algorithm
+--eval alter table a1 order by a
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_BAD_FIELD_ERROR
+}
+--error 0,$alter_error
+--eval alter table t1 rename column f to new_f, $force_needed algorithm=copy
+--eval alter table t1 convert to character set 'utf8', $force_needed algorithm=copy
+--eval alter table t1 default character set 'utf8', $force_needed algorithm=copy
+--eval alter table t1 default collate 'utf8_icelandic_ci', $force_needed algorithm=copy
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column new_f ,drop column g, drop column h, $force_needed algorithm=$alter_algorithm
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl add index if not exists index_1(f), $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl disable keys, $force_needed algorithm=copy
+--eval alter table tmp_tbl enable keys, $force_needed algorithm=copy
+--eval alter table a1 order by a
+--eval alter table tmp_tbl rename column f to new_f, $force_needed algorithm=copy
+--eval alter table tmp_tbl convert to character set 'utf8', $force_needed algorithm=copy
+--eval alter table tmp_tbl default character set 'utf8', $force_needed algorithm=copy
+--eval alter table tmp_tbl default collate 'utf8_icelandic_ci', $force_needed algorithm=copy
+--eval alter table tmp_tbl drop column new_f ,drop column g, drop column h, $force_needed algorithm=$alter_algorithm
+}
+##--eval alter table t1 discard tablespace;
+######--eval alter table t1 import tablespace;
+
+--echo # show binlog and clear status
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+# Only add partition and remove partition is tested
+# | ADD PARTITION (partition_definition)
+# | REMOVE PARTITIONING
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_ALTER_OPERATION_NOT_SUPPORTED
+}
+--error 0,$alter_error
+--eval alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+--eval alter table t1 partition by hash(b) partitions 8
+--eval alter table t1 remove partitioning
+if (`select '$alter_algorithm' = 'instant' or '$alter_algorithm' = 'nocopy'`)
+{
+ --let $alter_error=ER_CANT_DROP_FIELD_OR_KEY
+}
+--error 0,$alter_error
+--eval alter table t1 drop column f ,drop column g, drop column h, $force_needed algorithm=$alter_algorithm
+if ($alter_algorithm == 'copy')
+{
+--eval alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, $force_needed algorithm=$alter_algorithm
+--eval alter table tmp_tbl drop column f ,drop column g, drop column h, $force_needed algorithm=$alter_algorithm
+}
+--echo # show binlog and clear status
+--sync_slave_with_master
+if ($show_binlog)
+{
+ --source include/show_binlog_events.inc
+}
+reset master;
+--connection master
+
+# clean master/slave
+--connection master
+drop table t1, a1;
+drop temporary table tmp_tbl;
+--sync_slave_with_master
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_rollback.result b/mysql-test/suite/rpl/r/rpl_alter_rollback.result
new file mode 100644
index 00000000000..3bd91a516c4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_alter_rollback.result
@@ -0,0 +1,54 @@
+#
+# Test verifies that "ROLLBACK ALTER" is written to binary log upon
+#ALTER command execution failure.
+#
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+create table t1 (f1 int primary key) engine=InnoDB;
+create table t2 (f1 int primary key,
+constraint c1 foreign key (f1) references t1(f1),
+constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+create table t2 (f1 int primary key,
+constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t1 (f1 int primary key) engine=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t2 (f1 int primary key,
+constraint c1 foreign key (f1) references t1(f1)) engine=innodb
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+master-bin.000001 # Gtid # # GTID #-#-# ROLLBACK ALTER id=#
+master-bin.000001 # Query # # use `test`; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+set foreign_key_checks = 0;
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+ERROR HY000: Duplicate FOREIGN KEY constraint name 'test/c1'
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t1 (f1 int primary key) engine=InnoDB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t2 (f1 int primary key,
+constraint c1 foreign key (f1) references t1(f1)) engine=innodb
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+master-bin.000001 # Gtid # # GTID #-#-# ROLLBACK ALTER id=#
+master-bin.000001 # Query # # use `test`; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; set foreign_key_checks=1; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+master-bin.000001 # Gtid # # GTID #-#-# ROLLBACK ALTER id=#
+master-bin.000001 # Query # # use `test`; set foreign_key_checks=1; alter table t2 add constraint c1 foreign key (f1) references t1(f1)
+connection slave;
+connection master;
+drop table t2, t1;
+connection slave;
+connection master;
+set global binlog_alter_two_phase=0;;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
index 54156685806..4c35d42d90a 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -3,6 +3,7 @@ include/master-slave.inc
*** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
connection master;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+call mtr.add_suppression("Incorrect definition of table mysql.gtid_slave_pos:.*");
connection slave;
connection slave;
include/stop_slave.inc
@@ -83,16 +84,16 @@ ERROR 25000: You are not allowed to execute this command in a transaction
ROLLBACK;
SET GLOBAL gtid_strict_mode= 1;
SET GLOBAL gtid_slave_pos = "0-1-1";
-ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
+ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_slave_pos = "";
-ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
+ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_strict_mode= 0;
SET GLOBAL gtid_slave_pos = "0-1-1";
Warnings:
-Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
+Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_slave_pos = "";
Warnings:
-Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
+Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
RESET MASTER;
SET GLOBAL gtid_slave_pos = "0-1-1";
START SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 7dd3907f102..513bc26a1cc 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -33,7 +33,7 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
-DELETE FROM t2 WHERE b <> UUID();
+DELETE FROM t2 WHERE b <> SYS_GUID();
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -64,7 +64,7 @@ DELETE FROM t2;
******************** INSERT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-INSERT INTO t1 VALUES(2, UUID());
+INSERT INTO t1 VALUES(2, SYS_GUID());
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
@@ -143,7 +143,7 @@ INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t1 VALUES(3, 't1, text 3');
REPLACE INTO t1 VALUES(1, 't1, text 11');
-REPLACE INTO t1 VALUES(2, UUID());
+REPLACE INTO t1 VALUES(2, SYS_GUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
SELECT COUNT(*) FROM t1;
@@ -178,7 +178,7 @@ DELETE FROM t2;
******************** SELECT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-SELECT * FROM t1 WHERE b <> UUID() ORDER BY a;
+SELECT * FROM t1 WHERE b <> SYS_GUID() ORDER BY a;
a b
1 t1, text 1
DELETE FROM t1;
@@ -203,7 +203,7 @@ DELETE FROM t2;
******************** UNION ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
-SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> UUID();
+SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> SYS_GUID();
a b
1 t1, text 1
1 t2, text 1
@@ -430,7 +430,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
INSERT INTO t1 VALUES (6, 'after savepoint s2');
-INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
+INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
@@ -598,7 +598,7 @@ UPDATE t1 SET b = 'test' WHERE a = 201;
END|
CREATE PROCEDURE p2 ()
BEGIN
-UPDATE t1 SET b = UUID() WHERE a = 202;
+UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END|
INSERT INTO t1 VALUES(201, 'test 201');
CALL p1();
@@ -790,7 +790,7 @@ DELETE FROM t2;
INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
-CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
+CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> SYS_GUID();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci
@@ -850,7 +850,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # DELETE FROM t2 WHERE b <> UUID()
+master-bin.000001 # Annotate_rows # # DELETE FROM t2 WHERE b <> SYS_GUID()
master-bin.000001 # Table_map # # table_id: # (test_rpl.t2)
master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -864,7 +864,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES(2, UUID())
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES(2, SYS_GUID())
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -912,7 +912,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # REPLACE INTO t1 VALUES(2, UUID())
+master-bin.000001 # Annotate_rows # # REPLACE INTO t1 VALUES(2, SYS_GUID())
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1007,7 +1007,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2')
master-bin.000001 # Query # # SAVEPOINT `s2`
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2')
-master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()))
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()))
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1049,7 +1049,7 @@ END
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`()
BEGIN
-UPDATE t1 SET b = UUID() WHERE a = 202;
+UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201')
@@ -1061,7 +1061,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # UPDATE t1 SET b = UUID() WHERE a = 202
+master-bin.000001 # Annotate_rows # # UPDATE t1 SET b = SYS_GUID() WHERE a = 202
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1124,7 +1124,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> UUID()
+master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> SYS_GUID()
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_1.result b/mysql-test/suite/rpl/r/rpl_start_alter_1.result
new file mode 100644
index 00000000000..9edb23216fe
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_1.result
@@ -0,0 +1,313 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+# Legacy Master Slave
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+set global gtid_strict_mode = 0;;
+connection master;
+set global binlog_alter_two_phase=0;;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_2.result b/mysql-test/suite/rpl/r/rpl_start_alter_2.result
new file mode 100644
index 00000000000..a862fc5556a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_2.result
@@ -0,0 +1,326 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+connection slave;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+# Parallel Slave
+connection master;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+# cleanup
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=0;;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_3.result b/mysql-test/suite/rpl/r/rpl_start_alter_3.result
new file mode 100644
index 00000000000..97754401471
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_3.result
@@ -0,0 +1,326 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+connection slave;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+# Parallel Slave
+connection master;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+# cleanup
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=0;;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_4.result b/mysql-test/suite/rpl/r/rpl_start_alter_4.result
new file mode 100644
index 00000000000..9d7d6376bba
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_4.result
@@ -0,0 +1,327 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+connection slave;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+# Parallel Slave
+connection master;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+# cleanup
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=0;;
+set global gtid_domain_id= 0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_5.result b/mysql-test/suite/rpl/r/rpl_start_alter_5.result
new file mode 100644
index 00000000000..4e592c1931f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_5.result
@@ -0,0 +1,327 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+connection slave;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+# Parallel Slave
+connection master;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+# cleanup
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=0;;
+set global gtid_domain_id= 0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_6.result b/mysql-test/suite/rpl/r/rpl_start_alter_6.result
new file mode 100644
index 00000000000..6c26d511ee2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_6.result
@@ -0,0 +1,329 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection slave;
+set global gtid_strict_mode=1;
+connection slave;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+set global slave_domain_parallel_threads=3;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+# Parallel Slave
+connection master;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+# concurrent alter Myisam
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Aria
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb copy
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# concurrent alter Innodb Inplace
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Concurrent DML
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+# diff_table of master and slave , we will do only in the case when
+# sync_slave is on
+include/diff_tables.inc [master_node:t1, slave_node:t1]
+include/diff_tables.inc [master_node:t2, slave_node:t2]
+include/diff_tables.inc [master_node:t3, slave_node:t3]
+include/diff_tables.inc [master_node:t4, slave_node:t4]
+include/diff_tables.inc [master_node:t5, slave_node:t5]
+include/diff_tables.inc [master_node:t6, slave_node:t6]
+include/diff_tables.inc [master_node:t7, slave_node:t7]
+include/diff_tables.inc [master_node:t8, slave_node:t8]
+include/diff_tables.inc [master_node:t9, slave_node:t9]
+include/diff_tables.inc [master_node:t10, slave_node:t10]
+# Sync slave
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+# cleanup
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global slave_domain_parallel_threads = 0;;
+set global gtid_domain_id= 0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=0;;
+set global gtid_domain_id= 0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_7.result b/mysql-test/suite/rpl/r/rpl_start_alter_7.result
new file mode 100644
index 00000000000..cfe31497179
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_7.result
@@ -0,0 +1,368 @@
+connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connection server_1;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection server_2;
+stop slave;
+Warnings:
+Note 1255 Slave already has been stopped
+set global binlog_alter_two_phase=true;
+connection server_3;
+SET GLOBAL slave_parallel_threads=8;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+connection server_1;
+set gtid_domain_id= 11;
+create database s1;
+use s1;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 11;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 11;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_1;
+drop database s1;
+select @@gtid_binlog_pos;
+@@gtid_binlog_pos
+11-1-412
+connection server_2;
+set gtid_domain_id= 12;
+create database s2;
+use s2;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 12;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 12;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_2;
+drop database s2;
+select @@gtid_binlog_pos;
+@@gtid_binlog_pos
+12-2-412
+connection server_3;
+start all slaves;
+Warnings:
+Note 1937 SLAVE 'm2' started
+Note 1937 SLAVE 'm1' started
+set default_master_connection = 'm1';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm2';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm1';
+include/sync_with_master_gtid.inc
+set default_master_connection = 'm2';
+include/sync_with_master_gtid.inc
+# cleanup
+connection server_3;
+set default_master_connection = 'm1';
+include/stop_slave.inc
+set default_master_connection = 'm2';
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+reset master;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+connection server_1;
+set global binlog_alter_two_phase=0;;
+set global gtid_domain_id= 0;
+reset master;
+connection server_2;
+set global gtid_domain_id= 0;
+set global binlog_alter_two_phase=0;
+reset master;
+disconnect server_1;
+disconnect server_2;
+disconnect server_3;
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_8.result b/mysql-test/suite/rpl/r/rpl_start_alter_8.result
new file mode 100644
index 00000000000..8002f295f5c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_8.result
@@ -0,0 +1,362 @@
+connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connection server_1;
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+connection server_2;
+stop slave;
+Warnings:
+Note 1255 Slave already has been stopped
+set global binlog_alter_two_phase=true;
+connection server_3;
+SET GLOBAL slave_parallel_threads=20;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+connection server_1;
+set gtid_domain_id= 11;
+create database s1;
+use s1;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 11;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 11;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_1;
+drop database s1;
+connection server_2;
+set gtid_domain_id= 12;
+create database s2;
+use s2;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 12;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 12;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_2;
+drop database s2;
+connection server_3;
+start all slaves;
+Warnings:
+Note 1937 SLAVE 'm2' started
+Note 1937 SLAVE 'm1' started
+set default_master_connection = 'm1';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm2';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm1';
+include/sync_with_master_gtid.inc
+set default_master_connection = 'm2';
+include/sync_with_master_gtid.inc
+# cleanup
+connection server_3;
+set default_master_connection = 'm1';
+include/stop_slave.inc
+set default_master_connection = 'm2';
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set global gtid_domain_id= 0;
+reset master;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+connection server_1;
+set global binlog_alter_two_phase=0;;
+set global gtid_domain_id= 0;
+reset master;
+connection server_2;
+set global gtid_domain_id= 0;
+set global binlog_alter_two_phase=0;;
+reset master;
+disconnect server_1;
+disconnect server_2;
+disconnect server_3;
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_bugs.result b/mysql-test/suite/rpl/r/rpl_start_alter_bugs.result
new file mode 100644
index 00000000000..3fb3df27afd
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_bugs.result
@@ -0,0 +1,33 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase=true;
+connection slave;
+stop slave;
+SET global slave_parallel_threads=2;
+set global slave_parallel_mode=optimistic;
+start slave;
+connection master;
+CREATE TABLE t1 (i int primary key) ENGINE = InnoDB;
+connection master1;
+ALTER TABLE t1 DROP PRIMARY KEY;
+ALTER TABLE t1 ADD UNIQUE KEY ui (i);
+ALTER TABLE t1 ADD PRIMARY KEY (i);
+connection slave;
+connection master;
+drop table t1;
+CREATE TABLE t1 (a int)engine=innodb;
+ALTER TABLE t1 add column b int, LOCK=EXCLUSIVE;
+drop table t1;
+CREATE TABLE t1 (pk int)engine=innodb;
+ALTER TABLE t1 DROP FOREIGN KEY y, LOCK=EXCLUSIVE;
+ERROR 42000: Can't DROP FOREIGN KEY `y`; check that it exists
+drop table t1;
+connection slave;
+connection master;
+set global binlog_alter_two_phase=false;
+connection slave;
+include/stop_slave.inc
+SET global slave_parallel_threads=0;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_chain_basic.result b/mysql-test/suite/rpl/r/rpl_start_alter_chain_basic.result
new file mode 100644
index 00000000000..b6c28458561
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_chain_basic.result
@@ -0,0 +1,83 @@
+include/rpl_init.inc [topology=1->2->3->4]
+connection server_3;
+set global gtid_strict_mode=1;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+include/start_slave.inc
+connection server_1;
+set global binlog_alter_two_phase=ON;
+set binlog_alter_two_phase=ON;
+connect master_node,127.0.0.1,root,,$db_name, $SERVER_MYPORT_1;
+connect slave_node,127.0.0.1,root,,test, $SERVER_MYPORT_2;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+include/save_master_gtid.inc
+connection slave_node;
+include/sync_with_master_gtid.inc
+disconnect master_node;
+disconnect slave_node;
+connection server_1;
+set global binlog_alter_two_phase=0;
+include/rpl_sync.inc
+connection server_2;
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+domain_id seq_no
+0 12
+connection server_3;
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+domain_id seq_no
+0 12
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+select @@slave_parallel_threads;
+@@slave_parallel_threads
+0
+connection server_4;
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+domain_id seq_no
+0 12
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_ftwrl.result b/mysql-test/suite/rpl/r/rpl_start_alter_ftwrl.result
new file mode 100644
index 00000000000..4f22c2a1f5f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_ftwrl.result
@@ -0,0 +1,60 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+SET @@global.slave_parallel_threads=4;
+SET @@global.slave_parallel_mode=optimistic;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @@global.debug_dbug="+d,at_write_start_alter";
+include/start_slave.inc
+connection master;
+SET @@session.binlog_alter_two_phase=true;
+CREATE TABLE t1 (a INT) ENGINE=innodb;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+connection master;
+SET @@session.alter_algorithm='INSTANT';
+SET @@session.gtid_domain_id=11;
+ALTER TABLE t1 ADD COLUMN b int;
+# START Alter having exclusive lock is waiting for the signal
+connection slave;
+# FTWRL is sent first to wait for SA
+connection slave1;
+FLUSH TABLES WITH READ LOCK;
+# SA completes
+connection slave;
+set DEBUG_SYNC= "now signal alter_cont";
+connection slave1;
+connection slave;
+# Release CA
+connection slave1;
+UNLOCK TABLES;
+connection master;
+connection slave;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) ENGINE=innodb
+slave-bin.000001 # Gtid # # GTID #-#-# START ALTER
+slave-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN b int
+slave-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+slave-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN b int
+connection master;
+DROP TABLE t1;
+connection slave;
+# cleanup
+connection slave;
+set DEBUG_SYNC = RESET;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;
+set global slave_parallel_mode = optimistic;
+set @@global.debug_dbug = "";
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_instant.result b/mysql-test/suite/rpl/r/rpl_start_alter_instant.result
new file mode 100644
index 00000000000..17aaad81aa4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_instant.result
@@ -0,0 +1,66 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set binlog_alter_two_phase=true;
+CREATE OR REPLACE TABLE tab (
+a int PRIMARY KEY,
+b varchar(50),
+c varchar(50)
+) CHARACTER SET=latin1 engine=innodb;
+SET SESSION alter_algorithm='INSTANT';
+ALTER TABLE tab MODIFY COLUMN b varchar(100);
+SET SESSION alter_algorithm='NOCOPY';
+ALTER TABLE tab MODIFY COLUMN c varchar(100);
+SHOW CREATE TABLE tab;
+Table Create Table
+tab CREATE TABLE `tab` (
+ `a` int(11) NOT NULL,
+ `b` varchar(100) DEFAULT NULL,
+ `c` varchar(100) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE tab (
+a int PRIMARY KEY,
+b varchar(50),
+c varchar(50)
+) CHARACTER SET=latin1 engine=innodb
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100)
+master-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+master-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100)
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100)
+master-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+master-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100)
+connection slave;
+SHOW CREATE TABLE tab;
+Table Create Table
+tab CREATE TABLE `tab` (
+ `a` int(11) NOT NULL,
+ `b` varchar(100) DEFAULT NULL,
+ `c` varchar(100) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE tab (
+a int PRIMARY KEY,
+b varchar(50),
+c varchar(50)
+) CHARACTER SET=latin1 engine=innodb
+slave-bin.000001 # Gtid # # GTID #-#-# START ALTER
+slave-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100)
+slave-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+slave-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100)
+slave-bin.000001 # Gtid # # GTID #-#-# START ALTER
+slave-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100)
+slave-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+slave-bin.000001 # Query # # use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100)
+connection master;
+DROP TABLE tab;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result
new file mode 100644
index 00000000000..e008bbc81a7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_1.result
@@ -0,0 +1,172 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set global binlog_alter_two_phase=true;
+connection slave;
+include/stop_slave.inc
+change master to master_use_gtid= current_pos;
+set global gtid_strict_mode=1;
+# Legacy Master Slave
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 0;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 0;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection master;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-410
+RESET master;
+connection slave;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-410
+set global gtid_strict_mode=0;
+include/start_slave.inc
+connection master;
+set global binlog_alter_two_phase=false;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result
new file mode 100644
index 00000000000..2c1ae667fd6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_mysqlbinlog_2.result
@@ -0,0 +1,419 @@
+connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connection server_1;
+SET @save_binlog_alter_two_phase= @@GLOBAL.binlog_alter_two_phase;
+SET GLOBAL binlog_alter_two_phase = ON;
+SET binlog_alter_two_phase = ON;
+# Create table and perform CA and RA
+CREATE TABLE t1( a INT, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1);
+INSERT INTO t1 VALUES(2,2);
+# Normal Alter
+ALTER TABLE t1 ADD COLUMN c INT;
+# Failed Alter
+INSERT INTO t1 VALUES(1,1, NULL);
+ALTER TABLE t1 CHANGE a a INT UNIQUE;
+ERROR 23000: Duplicate entry '1' for key 'a'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-8
+# apply the binlog
+DROP TABLE t1;
+# reset the binlog
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+0-1-8
+# Same as before
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+# reset the binlog
+RESET MASTER;
+RESET SLAVE;
+connection server_2;
+SET @save_binlog_alter_two_phase= @@GLOBAL.binlog_alter_two_phase;
+SET GLOBAL binlog_alter_two_phase = ON;
+connection server_3;
+SET @save_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET @slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @slave_parallel_mode= @@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_threads=20;
+SET GLOBAL slave_parallel_mode=optimistic;
+SET GLOBAL gtid_strict_mode=1;
+connection server_1;
+SET gtid_domain_id= 11;
+CREATE DATABASE s1;
+USE s1;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 11;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 11;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_1;
+DROP DATABASE s1;
+connection server_2;
+SET gtid_domain_id= 12;
+CREATE DATABASE s2;
+USE s2;
+connect master_node,127.0.0.1,root,,$db_name, $M_port;
+set gtid_domain_id= 12;;
+connect slave_node,127.0.0.1,root,,test, $S_port;
+set gtid_domain_id= 12;;
+# myisam
+connection master_node;
+create table t1(a int, b int) engine=myisam;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# innodb
+connection master_node;
+create table t1(a int, b int) engine=innodb;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master_node;
+drop table t1;
+# aria
+connection master_node;
+create table t1(a int, b int) engine=aria;;
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+# Normal Alter
+alter table t1 add column c int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+# Failed Alter
+insert into t1 values(1,1, NULL);
+alter table t1 change a a int unique;
+ERROR 23000: Duplicate entry '1' for key 'a'
+set @@session.binlog_alter_two_phase = 0;
+alter table t1 change a a int;
+set @@session.binlog_alter_two_phase = 1;
+alter table t1 change a a int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+connection master_node;
+drop table t1;
+# concurrent alter Myisam
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Aria
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb copy
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+# concurrent alter Innodb Inplace
+# Concurrent DML
+# Rollback tests
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+ERROR 23000: Duplicate entry '2' for key 'b'
+connection server_2;
+DROP DATABASE s2;
+connection server_3;
+START ALL SLAVES;
+Warnings:
+Note 1937 SLAVE 'm2' started
+Note 1937 SLAVE 'm1' started
+SET default_master_connection = 'm1';
+include/wait_for_slave_to_start.inc
+SET default_master_connection = 'm2';
+include/wait_for_slave_to_start.inc
+SET default_master_connection = 'm1';
+include/sync_with_master_gtid.inc
+SET default_master_connection = 'm2';
+include/sync_with_master_gtid.inc
+# Stop slaves and apply binlog
+connection server_3;
+SET default_master_connection = 'm1';
+include/stop_slave.inc
+SET default_master_connection = 'm2';
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads = @slave_parallel_threads;
+SET GLOBAL slave_parallel_mode = @slave_parallel_mode;
+SET GLOBAL gtid_strict_mode = @save_gtid_strict_mode;
+SET GLOBAL gtid_domain_id= 0;
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+11-1-412,12-2-412
+# reset the binlog
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+11-1-412,12-2-412
+# One more time to simulate S->S case
+RESET MASTER;
+# execute the binlog
+SELECT @@gtid_binlog_state;
+@@gtid_binlog_state
+11-1-412,12-2-412
+RESET MASTER;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+connection server_1;
+SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase;
+SET GLOBAL gtid_domain_id= 0;
+RESET MASTER;
+connection server_2;
+SET GLOBAL gtid_domain_id= 0;
+SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase;
+RESET MASTER;
+disconnect server_1;
+disconnect server_2;
+disconnect server_3;
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_optimize.result b/mysql-test/suite/rpl/r/rpl_start_alter_optimize.result
new file mode 100644
index 00000000000..24f016e93a0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_optimize.result
@@ -0,0 +1,18 @@
+include/master-slave.inc
+[connection master]
+connection master;
+set binlog_alter_two_phase = ON;
+connection master;
+CREATE TABLE t1 (i int) engine=innodb;
+CREATE TABLE t2 (i int) engine=innodb;
+ALTER TABLE t1 DROP CONSTRAINT IF EXISTS y;
+Warnings:
+Note 1091 Can't DROP CONSTRAINT `y`; check that it exists
+OPTIMIZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+connection slave;
+connection master;
+drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_options.result b/mysql-test/suite/rpl/r/rpl_start_alter_options.result
new file mode 100644
index 00000000000..30854b12be1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_options.result
@@ -0,0 +1,497 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+stop slave;
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+alter table t1 add column if not exists c int , force , algorithm=default;
+alter table t1 add column d int first, force , algorithm=default;
+alter table t1 add column e int after c, force , algorithm=default;
+alter table t1 add column f int after c, force , add column g int first ,add column h char, algorithm=default;
+alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=default;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=default;
+alter table t1 add index if not exists index_1(f), force , algorithm=default;
+alter table t1 drop index index_1, force , algorithm=default;
+alter table t1 add unique key unique_1(g), force , algorithm=default;
+alter table t1 drop index unique_1, force , algorithm=default;
+alter table t1 add fulltext key f_1(h), force , algorithm=default;
+alter table t1 drop column f, drop column g , force , algorithm=default;
+alter table t1 add primary key(h), force , algorithm=copy;
+alter table t1 drop primary key, force , algorithm=copy;
+alter table t1 drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=default;
+alter table t1 add period for system_time(f,h);
+alter table t1 add system versioning;
+alter table t1 drop system versioning;
+alter table t1 drop column f, drop column g , drop column h, force , algorithm=default;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=default ;;
+alter table t1 alter column f set default "****", force , algorithm=default ;;
+alter table t1 alter column f drop default, force , algorithm=default ;;
+alter table t1 change column g new_g char, force , algorithm=copy;;
+alter table t1 modify column h varchar(100), force , algorithm=copy;;
+alter table t1 drop column new_g ,drop column f, drop column h, force , algorithm=default ;;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=default;
+alter table t1 add index if not exists index_1(f), force , algorithm=default;
+alter table t1 disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 rename t2, force , algorithm=default;
+alter table t2 rename t1, force , algorithm=default;
+alter table a1 order by a;
+alter table t1 rename column f to new_f, force , algorithm=copy;
+alter table t1 convert to character set 'utf8', force , algorithm=copy;
+alter table t1 default character set 'utf8', force , algorithm=copy;
+alter table t1 default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table t1 drop column new_f ,drop column g, drop column h, force , algorithm=default;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=default;
+alter table t1 partition by hash(b) partitions 8;
+alter table t1 remove partitioning;
+alter table t1 drop column f ,drop column g, drop column h, force , algorithm=default;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+connection master;
+drop table t1, a1;
+drop temporary table tmp_tbl;
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+connection slave;
+stop slave;
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+alter table t1 add column if not exists c int , force , algorithm=inplace;
+alter table t1 add column d int first, force , algorithm=inplace;
+alter table t1 add column e int after c, force , algorithm=inplace;
+alter table t1 add column f int after c, force , add column g int first ,add column h char, algorithm=inplace;
+alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=inplace;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=inplace;
+alter table t1 add index if not exists index_1(f), force , algorithm=inplace;
+alter table t1 drop index index_1, force , algorithm=inplace;
+alter table t1 add unique key unique_1(g), force , algorithm=inplace;
+alter table t1 drop index unique_1, force , algorithm=inplace;
+alter table t1 add fulltext key f_1(h), force , algorithm=inplace;
+alter table t1 drop column f, drop column g , force , algorithm=inplace;
+alter table t1 add primary key(h), force , algorithm=copy;
+alter table t1 drop primary key, force , algorithm=copy;
+alter table t1 drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=inplace;
+alter table t1 add period for system_time(f,h);
+alter table t1 add system versioning;
+alter table t1 drop system versioning;
+alter table t1 drop column f, drop column g , drop column h, force , algorithm=inplace;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=inplace ;;
+alter table t1 alter column f set default "****", force , algorithm=inplace ;;
+alter table t1 alter column f drop default, force , algorithm=inplace ;;
+alter table t1 change column g new_g char, force , algorithm=copy;;
+alter table t1 modify column h varchar(100), force , algorithm=copy;;
+alter table t1 drop column new_g ,drop column f, drop column h, force , algorithm=inplace ;;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=inplace;
+alter table t1 add index if not exists index_1(f), force , algorithm=inplace;
+alter table t1 disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 rename t2, force , algorithm=inplace;
+alter table t2 rename t1, force , algorithm=inplace;
+alter table a1 order by a;
+alter table t1 rename column f to new_f, force , algorithm=copy;
+alter table t1 convert to character set 'utf8', force , algorithm=copy;
+alter table t1 default character set 'utf8', force , algorithm=copy;
+alter table t1 default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table t1 drop column new_f ,drop column g, drop column h, force , algorithm=inplace;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=inplace;
+alter table t1 partition by hash(b) partitions 8;
+alter table t1 remove partitioning;
+alter table t1 drop column f ,drop column g, drop column h, force , algorithm=inplace;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+connection master;
+drop table t1, a1;
+drop temporary table tmp_tbl;
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+connection slave;
+stop slave;
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+alter table t1 add column if not exists c int , force , algorithm=copy;
+alter table t1 add column d int first, force , algorithm=copy;
+alter table t1 add column e int after c, force , algorithm=copy;
+alter table t1 add column f int after c, force , add column g int first ,add column h char, algorithm=copy;
+alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=copy;
+alter table tmp_tbl add column if not exists c int , force , algorithm=copy;
+alter table tmp_tbl add column d int first, force , algorithm=copy;
+alter table tmp_tbl add column e int after c, force , algorithm=copy;
+alter table tmp_tbl add column f int after c, force , add column g int first ,add column h char, algorithm=copy;
+alter table tmp_tbl drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=copy;
+alter table t1 add index if not exists index_1(f), force , algorithm=copy;
+alter table t1 drop index index_1, force , algorithm=copy;
+alter table t1 add unique key unique_1(g), force , algorithm=copy;
+alter table t1 drop index unique_1, force , algorithm=copy;
+alter table t1 add fulltext key f_1(h), force , algorithm=copy;
+alter table t1 drop column f, drop column g , force , algorithm=copy;
+alter table tmp_tbl add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=copy;
+alter table tmp_tbl add index if not exists index_1(f), force , algorithm=copy;
+alter table tmp_tbl drop index index_1, force , algorithm=copy;
+alter table tmp_tbl add unique key unique_1(g), force , algorithm=copy;
+alter table tmp_tbl drop index unique_1, force , algorithm=copy;
+alter table tmp_tbl drop column f, drop column g , force , algorithm=copy;
+alter table t1 add primary key(h), force , algorithm=copy;
+alter table t1 drop primary key, force , algorithm=copy;
+alter table t1 drop column h, force , algorithm=copy;
+alter table tmp_tbl add primary key(h), force , algorithm=copy;
+alter table tmp_tbl drop primary key, force , algorithm=copy;
+alter table tmp_tbl drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table t1 add period for system_time(f,h);
+alter table t1 add system versioning;
+alter table t1 drop system versioning;
+alter table t1 drop column f, drop column g , drop column h, force , algorithm=copy;
+# show binlog and clear status
+alter table tmp_tbl add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table tmp_tbl drop column f, drop column g , drop column h, force , algorithm=copy;
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy ;;
+alter table t1 alter column f set default "****", force , algorithm=copy ;;
+alter table t1 alter column f drop default, force , algorithm=copy ;;
+alter table t1 change column g new_g char, force , algorithm=copy;;
+alter table t1 modify column h varchar(100), force , algorithm=copy;;
+alter table t1 drop column new_g ,drop column f, drop column h, force , algorithm=copy ;;
+alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy ;;
+alter table tmp_tbl alter column f set default "****", force , algorithm=copy ;;
+alter table tmp_tbl alter column f drop default, force , algorithm=copy ;;
+alter table tmp_tbl change column g new_g char, force , algorithm=copy;;
+alter table tmp_tbl modify column h varchar(100), force , algorithm=copy;;
+alter table tmp_tbl drop column new_g ,drop column f, drop column h, force , algorithm=copy ;;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table t1 add index if not exists index_1(f), force , algorithm=copy;
+alter table t1 disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 rename t2, force , algorithm=copy;
+alter table t2 rename t1, force , algorithm=copy;
+alter table a1 order by a;
+alter table t1 rename column f to new_f, force , algorithm=copy;
+alter table t1 convert to character set 'utf8', force , algorithm=copy;
+alter table t1 default character set 'utf8', force , algorithm=copy;
+alter table t1 default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table t1 drop column new_f ,drop column g, drop column h, force , algorithm=copy;
+alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table tmp_tbl add index if not exists index_1(f), force , algorithm=copy;
+alter table tmp_tbl disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`tmp_tbl` doesn't have this option
+alter table tmp_tbl enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`tmp_tbl` doesn't have this option
+alter table a1 order by a;
+alter table tmp_tbl rename column f to new_f, force , algorithm=copy;
+alter table tmp_tbl convert to character set 'utf8', force , algorithm=copy;
+alter table tmp_tbl default character set 'utf8', force , algorithm=copy;
+alter table tmp_tbl default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table tmp_tbl drop column new_f ,drop column g, drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table t1 partition by hash(b) partitions 8;
+alter table t1 remove partitioning;
+alter table t1 drop column f ,drop column g, drop column h, force , algorithm=copy;
+alter table tmp_tbl add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=copy;
+alter table tmp_tbl drop column f ,drop column g, drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+connection master;
+drop table t1, a1;
+drop temporary table tmp_tbl;
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+# Prove formal support for nocopy and instant
+connection slave;
+stop slave;
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+alter table t1 add column if not exists c int , force , algorithm=instant;
+alter table t1 add column d int first, force , algorithm=instant;
+alter table t1 add column e int after c, force , algorithm=instant;
+alter table t1 add column f int after c, force , add column g int first ,add column h char, algorithm=instant;
+alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=instant;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=instant;
+alter table t1 add index if not exists index_1(f), force , algorithm=instant;
+alter table t1 drop index index_1, force , algorithm=instant;
+alter table t1 add unique key unique_1(g), force , algorithm=instant;
+alter table t1 drop index unique_1, force , algorithm=instant;
+alter table t1 add fulltext key f_1(h), force , algorithm=instant;
+alter table t1 drop column f, drop column g , force , algorithm=instant;
+alter table t1 add primary key(h), force , algorithm=copy;
+alter table t1 drop primary key, force , algorithm=copy;
+alter table t1 drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=instant;
+alter table t1 add period for system_time(f,h);
+alter table t1 add system versioning;
+alter table t1 drop system versioning;
+alter table t1 drop column f, drop column g , drop column h, force , algorithm=instant;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=instant ;;
+alter table t1 alter column f set default "****", force , algorithm=instant ;;
+alter table t1 alter column f drop default, force , algorithm=instant ;;
+alter table t1 change column g new_g char, force , algorithm=copy;;
+alter table t1 modify column h varchar(100), force , algorithm=copy;;
+alter table t1 drop column new_g ,drop column f, drop column h, force , algorithm=instant ;;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=instant;
+alter table t1 add index if not exists index_1(f), force , algorithm=instant;
+alter table t1 disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 rename t2, force , algorithm=instant;
+alter table t2 rename t1, force , algorithm=instant;
+alter table a1 order by a;
+alter table t1 rename column f to new_f, force , algorithm=copy;
+alter table t1 convert to character set 'utf8', force , algorithm=copy;
+alter table t1 default character set 'utf8', force , algorithm=copy;
+alter table t1 default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table t1 drop column new_f ,drop column g, drop column h, force , algorithm=instant;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=instant;
+alter table t1 partition by hash(b) partitions 8;
+alter table t1 remove partitioning;
+alter table t1 drop column f ,drop column g, drop column h, force , algorithm=instant;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+connection master;
+drop table t1, a1;
+drop temporary table tmp_tbl;
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+connection slave;
+stop slave;
+change master to master_use_gtid= current_pos;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+set binlog_alter_two_phase=true;
+create table t1(a int , b int) engine=innodb;
+create table a1(a int , b int) engine=myisam;
+create temporary table tmp_tbl(a int, b int) engine=innodb;
+alter table t1 add column if not exists c int , force , algorithm=nocopy;
+alter table t1 add column d int first, force , algorithm=nocopy;
+alter table t1 add column e int after c, force , algorithm=nocopy;
+alter table t1 add column f int after c, force , add column g int first ,add column h char, algorithm=nocopy;
+alter table t1 drop column c, drop column d, drop column e, drop column f, drop column g , drop column h, force , algorithm=nocopy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f int after b, force , add column g int first ,add column h varchar(100), algorithm=nocopy;
+alter table t1 add index if not exists index_1(f), force , algorithm=nocopy;
+alter table t1 drop index index_1, force , algorithm=nocopy;
+alter table t1 add unique key unique_1(g), force , algorithm=nocopy;
+alter table t1 drop index unique_1, force , algorithm=nocopy;
+alter table t1 add fulltext key f_1(h), force , algorithm=nocopy;
+alter table t1 drop column f, drop column g , force , algorithm=nocopy;
+alter table t1 add primary key(h), force , algorithm=copy;
+alter table t1 drop primary key, force , algorithm=copy;
+alter table t1 drop column h, force , algorithm=copy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b, add column g varchar(100) first ,add column h char, force , algorithm=nocopy;
+alter table t1 add period for system_time(f,h);
+alter table t1 add system versioning;
+alter table t1 drop system versioning;
+alter table t1 drop column f, drop column g , drop column h, force , algorithm=nocopy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=nocopy ;;
+alter table t1 alter column f set default "****", force , algorithm=nocopy ;;
+alter table t1 alter column f drop default, force , algorithm=nocopy ;;
+alter table t1 change column g new_g char, force , algorithm=copy;;
+alter table t1 modify column h varchar(100), force , algorithm=copy;;
+alter table t1 drop column new_g ,drop column f, drop column h, force , algorithm=nocopy ;;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=nocopy;
+alter table t1 add index if not exists index_1(f), force , algorithm=nocopy;
+alter table t1 disable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 enable keys, force , algorithm=copy;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
+alter table t1 rename t2, force , algorithm=nocopy;
+alter table t2 rename t1, force , algorithm=nocopy;
+alter table a1 order by a;
+alter table t1 rename column f to new_f, force , algorithm=copy;
+alter table t1 convert to character set 'utf8', force , algorithm=copy;
+alter table t1 default character set 'utf8', force , algorithm=copy;
+alter table t1 default collate 'utf8_icelandic_ci', force , algorithm=copy;
+alter table t1 drop column new_f ,drop column g, drop column h, force , algorithm=nocopy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+alter table t1 add column f varchar(100) after b,add column g varchar(100) first ,add column h char, force , algorithm=nocopy;
+alter table t1 partition by hash(b) partitions 8;
+alter table t1 remove partitioning;
+alter table t1 drop column f ,drop column g, drop column h, force , algorithm=nocopy;
+# show binlog and clear status
+connection slave;
+reset master;
+connection master;
+connection master;
+drop table t1, a1;
+drop temporary table tmp_tbl;
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_para_to_seq.result b/mysql-test/suite/rpl/r/rpl_start_alter_para_to_seq.result
new file mode 100644
index 00000000000..d93ec724372
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_para_to_seq.result
@@ -0,0 +1,14 @@
+include/master-slave.inc
+[connection master]
+connection master;
+CREATE TABLE t1 (a1 int, d1 int DEFAULT 0);
+INSERT INTO t1 VALUES (1,1) ;
+SET binlog_alter_two_phase = ON;
+ALTER TABLE t1 WAIT 9 RENAME COLUMN a1 TO a2;
+SET binlog_alter_two_phase = OFF;
+ALTER TABLE t1 ALTER COLUMN d1 DROP DEFAULT;
+connection slave;
+connection master;
+drop table t1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result
new file mode 100644
index 00000000000..a2aba33aee0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+SET @old_debug_slave= @@global.debug;
+stop slave;
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+connection master;
+call mtr.add_suppression("ALTER query started at .+ could not be completed");
+SET @old_debug_master= @@global.debug;
+set binlog_alter_two_phase=true;
+create table t3( a int primary key, b int) engine=innodb;
+connection master;
+connection slave;
+include/stop_slave.inc
+connection master;
+SET SESSION debug_dbug="d,start_alter_kill_after_binlog";
+alter table t3 add column d int;
+ERROR HY000: Lost connection to server during query
+include/rpl_reconnect.inc
+set binlog_alter_two_phase= true;
+alter table t3 add column d int;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `d` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'ALTER query started at .+ could not be completed' COLLATE 'latin1_swedish_ci'))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t3( a int primary key, b int) engine=innodb
+master-bin.000001 # Gtid # # GTID #-#-# START ALTER
+master-bin.000001 # Query # # use `test`; alter table t3 add column d int
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid # # GTID #-#-# START ALTER
+master-bin.000002 # Query # # use `test`; alter table t3 add column d int
+master-bin.000002 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+master-bin.000002 # Query # # use `test`; alter table t3 add column d int
+connection slave;
+include/start_slave.inc
+connection master;
+connection slave;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'ALTER query started at .+ could not be completed' COLLATE 'latin1_swedish_ci'))
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create table t3( a int primary key, b int) engine=innodb
+slave-bin.000001 # Gtid # # GTID #-#-# START ALTER
+slave-bin.000001 # Query # # use `test`; alter table t3 add column d int
+slave-bin.000001 # Gtid # # GTID #-#-# START ALTER
+slave-bin.000001 # Query # # use `test`; alter table t3 add column d int
+slave-bin.000001 # Gtid # # GTID #-#-# COMMIT ALTER id=#
+slave-bin.000001 # Query # # use `test`; alter table t3 add column d int
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `d` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master;
+SET GLOBAL debug_dbug= @old_debug_master;
+drop table t3;
+set global binlog_alter_two_phase = 0;
+connection slave;
+SET GLOBAL debug_dbug= @old_debug_slave;
+stop slave;
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+start slave;
+connection master;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result
new file mode 100644
index 00000000000..0a1c1f7971e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result
@@ -0,0 +1,119 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+SET @old_debug_slave= @@global.debug;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog";
+include/start_slave.inc
+connection master;
+SET @old_debug_master= @@global.debug;
+set global debug_dbug="+d,start_alter_delay_master";
+set global binlog_alter_two_phase=true;
+create table t1( a int primary key, b int) engine=myisam;
+create table t2( a int primary key, b int) engine=myisam;
+connect con1,localhost,root,,;
+alter table t1 add column c int;;
+connection master;
+# Get into binlog first and wait
+# master gtid state is 0-1-3
+connect con2,localhost,root,,;
+alter table t2 add column c int;;
+connection master;
+# Get into binlog next and wait as well
+# master gtid state is 0-1-4
+set DEBUG_SYNC= "now signal alter_cont";
+connection con1;
+connection con2;
+create table t3( a int primary key, b int) engine=innodb;
+# master gtid state is 0-1-7
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid_list 1 # []
+master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001
+master-bin.000001 # Gtid 1 # GTID #-#-#
+master-bin.000001 # Query 1 # use `test`; create table t1( a int primary key, b int) engine=myisam
+master-bin.000001 # Gtid 1 # GTID #-#-#
+master-bin.000001 # Query 1 # use `test`; create table t2( a int primary key, b int) engine=myisam
+master-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+master-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+master-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+master-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+master-bin.000001 # Gtid 1 # GTID #-#-# COMMIT ALTER id=<seq_no>
+master-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+master-bin.000001 # Gtid 1 # GTID #-#-# COMMIT ALTER id=<seq_no>
+master-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+master-bin.000001 # Gtid 1 # GTID #-#-#
+master-bin.000001 # Query 1 # use `test`; create table t3( a int primary key, b int) engine=innodb
+# Stop Slave
+# As master binlog is SA SA CA CA
+# let's stop at first CA processing (in process_commit_alter)
+connection slave;
+include/sync_with_master_gtid.inc
+connect extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
+stop slave;;
+connection slave;
+connection extra_slave;
+SET GLOBAL debug_dbug= @old_debug_slave;
+connection slave;
+include/wait_for_slave_sql_to_stop.inc
+# The list of events after the slave has stopped must have just one CA:
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid_list 2 # []
+slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001
+slave-bin.000001 # Gtid 1 # GTID #-#-#
+slave-bin.000001 # Query 1 # use `test`; create table t1( a int primary key, b int) engine=myisam
+slave-bin.000001 # Gtid 1 # GTID #-#-#
+slave-bin.000001 # Query 1 # use `test`; create table t2( a int primary key, b int) engine=myisam
+slave-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-# COMMIT ALTER id=<seq_no>
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+domain_id seq_no
+0 5
+include/start_slave.inc
+connection master;
+connection slave;
+# Everything from the master binlog must have been applied now:
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+domain_id seq_no
+0 7
+# slave gtid state is 0-1-7
+# The list of events after the slave has synchronized must have both CA:
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid_list 2 # []
+slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001
+slave-bin.000001 # Gtid 1 # GTID #-#-#
+slave-bin.000001 # Query 1 # use `test`; create table t1( a int primary key, b int) engine=myisam
+slave-bin.000001 # Gtid 1 # GTID #-#-#
+slave-bin.000001 # Query 1 # use `test`; create table t2( a int primary key, b int) engine=myisam
+slave-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-# START ALTER
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-# COMMIT ALTER id=<seq_no>
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-# COMMIT ALTER id=<seq_no>
+slave-bin.000001 # Query 1 # use `test`; alter table <t> add column c int
+slave-bin.000001 # Gtid 1 # GTID #-#-#
+slave-bin.000001 # Query 1 # use `test`; create table t3( a int primary key, b int) engine=innodb
+connection master;
+drop table t1,t2,t3;
+set global binlog_alter_two_phase = 0;
+SET GLOBAL debug_dbug= @old_debug_master;
+set DEBUG_SYNC= 'RESET';
+connection slave;
+stop slave;
+set global slave_parallel_threads = 0;;
+set global slave_parallel_mode = optimistic;;
+set global gtid_strict_mode = 0;;
+set DEBUG_SYNC= 'RESET';
+start slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index b9c636fa582..639b107abd6 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -4,7 +4,7 @@ include/master-slave.inc
connection master;
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
-INSERT INTO t1 VALUES (UUID());
+INSERT INTO t1 VALUES (SYS_GUID());
connection slave;
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
@@ -121,12 +121,12 @@ master-bin.000001 # Query # # COMMIT
BEGIN;
DROP TEMPORARY TABLE t1;
# The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
-INSERT IGNORE INTO t1 VALUES(uuid()+0);
+INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0);
COMMIT;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT IGNORE INTO t1 VALUES(uuid()+0)
+master-bin.000001 # Annotate_rows # # INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/rpl/t/rpl_alter_rollback.test b/mysql-test/suite/rpl/t/rpl_alter_rollback.test
new file mode 100644
index 00000000000..c24f01ff007
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_alter_rollback.test
@@ -0,0 +1,42 @@
+#
+# MENT-662: Lag Free Alter On Slave
+#
+
+--echo #
+--echo # Test verifies that "ROLLBACK ALTER" is written to binary log upon
+--echo #ALTER command execution failure.
+--echo #
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+
+create table t1 (f1 int primary key) engine=InnoDB;
+--error ER_CANT_CREATE_TABLE
+create table t2 (f1 int primary key,
+constraint c1 foreign key (f1) references t1(f1),
+constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
+create table t2 (f1 int primary key,
+ constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
+
+--error ER_CANT_CREATE_TABLE
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+--source include/show_binlog_events.inc
+
+set foreign_key_checks = 0;
+--error ER_DUP_CONSTRAINT_NAME
+alter table t2 add constraint c1 foreign key (f1) references t1(f1);
+--source include/show_binlog_events.inc
+--sync_slave_with_master
+
+--connection master
+drop table t2, t1;
+--sync_slave_with_master
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
index 07fc1e558cb..f7aefd625a1 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole_row_annotate.test
@@ -44,6 +44,6 @@ FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /xid=\d*/xid=<xid>/
---exec $MYSQL_BINLOG --base64-output=decode-rows $MYSQLD_DATADIR/slave-bin.000001
+--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-gtid-strict-mode $MYSQLD_DATADIR/slave-bin.000001
source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
index c02e2670c92..412489b3ee3 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test
@@ -5,6 +5,7 @@
--echo *** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
--connection master
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+call mtr.add_suppression("Incorrect definition of table mysql.gtid_slave_pos:.*");
--sync_slave_with_master
--connection slave
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_1.test b/mysql-test/suite/rpl/t/rpl_start_alter_1.test
new file mode 100644
index 00000000000..9ce061f1031
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_1.test
@@ -0,0 +1,33 @@
+#
+# Start Alter with Legacy Replication
+#
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+set global gtid_strict_mode=1;
+
+--echo # Legacy Master Slave
+--let $domain_1=0
+--let $domain_2=0
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_2.test b/mysql-test/suite/rpl/t/rpl_start_alter_2.test
new file mode 100644
index 00000000000..457409c51a6
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_2.test
@@ -0,0 +1,53 @@
+#
+# Start Alter with Parallel Replication
+# 1 domain id
+# |Concurrent alters| < |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/master-slave.inc
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+set global gtid_strict_mode=1;
+
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo # Parallel Slave
+--connection master
+--let $master_server= "master"
+--let $domain_1=0
+--let $domain_2=0
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+--source include/start_slave.inc
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_3.test b/mysql-test/suite/rpl/t/rpl_start_alter_3.test
new file mode 100644
index 00000000000..b280aeb9e5e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_3.test
@@ -0,0 +1,54 @@
+#
+# Start Alter with Parallel Replication
+# 1 domain id
+# |Concurrent alters| >= |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+set global gtid_strict_mode=1;
+
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo # Parallel Slave
+--connection master
+--let $master_server= "master"
+--let $domain_1=0
+--let $domain_2=0
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+--source include/start_slave.inc
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_4.test b/mysql-test/suite/rpl/t/rpl_start_alter_4.test
new file mode 100644
index 00000000000..8c67b50a7bf
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_4.test
@@ -0,0 +1,54 @@
+#
+# Start Alter with Parallel Replication
+# 2 domain id
+# |Concurrent alters| < |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+set global gtid_strict_mode=1;
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo # Parallel Slave
+--connection master
+--let $master_server= "master"
+--let $domain_1=11
+--let $domain_2=12
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+--source include/start_slave.inc
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+set global gtid_domain_id= 0;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_5.test b/mysql-test/suite/rpl/t/rpl_start_alter_5.test
new file mode 100644
index 00000000000..10d0d523a68
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_5.test
@@ -0,0 +1,54 @@
+#
+# Start Alter with Parallel Replication
+# 2 domain id
+# |Concurrent alters| >= |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+set global gtid_strict_mode=1;
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo # Parallel Slave
+--connection master
+--let $master_server= "master"
+--let $domain_1=11
+--let $domain_2=12
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+--source include/start_slave.inc
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+set global gtid_domain_id= 0;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_6.test b/mysql-test/suite/rpl/t/rpl_start_alter_6.test
new file mode 100644
index 00000000000..fc49ea4a406
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_6.test
@@ -0,0 +1,58 @@
+#
+# Start Alter with Parallel Replication
+# 2 domain id
+# |Concurrent alters| < |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+# slave_domain_parallel_threads < |Concurrent Alters|
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+--connection master
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+--connection slave
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+--let $slave_domain_parallel_threads= `select @@slave_domain_parallel_threads`
+set global gtid_strict_mode=1;
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+set global slave_domain_parallel_threads=3;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--echo # Parallel Slave
+--connection master
+--let $master_server= "master"
+--let $domain_1=11
+--let $domain_2=12
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=1
+--source include/start_alter_include.inc
+--connection master
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+--eval set global slave_domain_parallel_threads = $slave_domain_parallel_threads;
+set global gtid_domain_id= 0;
+--source include/start_slave.inc
+
+--connection master
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+set global gtid_domain_id= 0;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_7.cnf b/mysql-test/suite/rpl/t/rpl_start_alter_7.cnf
new file mode 100644
index 00000000000..a0f6dc5710c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_7.cnf
@@ -0,0 +1,19 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
+[mysqld.3]
+log-bin
+log-slave-updates
+
+
+[ENV]
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_7.test b/mysql-test/suite/rpl/t/rpl_start_alter_7.test
new file mode 100644
index 00000000000..7225c075ea7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_7.test
@@ -0,0 +1,112 @@
+#
+# Start Alter with Parallel Replication, With 2 sources
+# 2 domain id (From 2 sources)
+# |Concurrent alters| >= |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+--connection server_1
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+
+--connection server_2
+stop slave;
+set global binlog_alter_two_phase=true;
+
+--connection server_3
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+SET GLOBAL slave_parallel_threads=8;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+
+
+--disable_warnings
+--disable_query_log
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+--enable_query_log
+--enable_warnings
+
+--connection server_1
+set gtid_domain_id= 11;
+create database s1;
+use s1;
+--let $domain_1=11
+--let $domain_2=11
+--let $M_port= $SERVER_MYPORT_1
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s1
+--source include/start_alter_include.inc
+--connection server_1
+drop database s1;
+select @@gtid_binlog_pos;
+--let $master_pos_1= `SELECT @@gtid_binlog_pos`
+
+--connection server_2
+set gtid_domain_id= 12;
+create database s2;
+use s2;
+--let $domain_1=12
+--let $domain_2=12
+--let $M_port= $SERVER_MYPORT_2
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s2
+--source include/start_alter_include.inc
+--connection server_2
+drop database s2;
+select @@gtid_binlog_pos;
+--let $master_pos_2= `SELECT @@gtid_binlog_pos`
+
+--connection server_3
+start all slaves;
+set default_master_connection = 'm1';
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = 'm2';
+--source include/wait_for_slave_to_start.inc
+
+set default_master_connection = 'm1';
+--let $master_pos= $master_pos_1
+--source include/sync_with_master_gtid.inc
+set default_master_connection = 'm2';
+--let $master_pos= $master_pos_2
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--connection server_3
+set default_master_connection = 'm1';
+--source include/stop_slave.inc
+set default_master_connection = 'm2';
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+reset master;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+
+--connection server_1
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+set global gtid_domain_id= 0;
+reset master;
+--connection server_2
+set global gtid_domain_id= 0;
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase
+reset master;
+
+--disconnect server_1
+--disconnect server_2
+--disconnect server_3
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_8.cnf b/mysql-test/suite/rpl/t/rpl_start_alter_8.cnf
new file mode 100644
index 00000000000..a0f6dc5710c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_8.cnf
@@ -0,0 +1,19 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
+[mysqld.3]
+log-bin
+log-slave-updates
+
+
+[ENV]
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_8.test b/mysql-test/suite/rpl/t/rpl_start_alter_8.test
new file mode 100644
index 00000000000..4ab8e2b01e5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_8.test
@@ -0,0 +1,109 @@
+#
+# Start Alter with Parallel Replication, With 2 sources
+# 2 domain id (From 2 sources)
+# |Concurrent alters| < |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+--connection server_1
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase = ON;
+set binlog_alter_two_phase = ON;
+
+--connection server_2
+stop slave;
+set global binlog_alter_two_phase=true;
+
+--connection server_3
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+SET GLOBAL slave_parallel_threads=20;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+
+--disable_warnings
+--disable_query_log
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+--enable_query_log
+--enable_warnings
+
+--connection server_1
+set gtid_domain_id= 11;
+create database s1;
+use s1;
+--let $domain_1=11
+--let $domain_2=11
+--let $M_port= $SERVER_MYPORT_1
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s1
+--source include/start_alter_include.inc
+--connection server_1
+drop database s1;
+--let $master_pos_1= `SELECT @@gtid_binlog_pos`
+
+--connection server_2
+set gtid_domain_id= 12;
+create database s2;
+use s2;
+--let $domain_1=12
+--let $domain_2=12
+--let $M_port= $SERVER_MYPORT_2
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s2
+--source include/start_alter_include.inc
+--connection server_2
+drop database s2;
+--let $master_pos_2= `SELECT @@gtid_binlog_pos`
+
+--connection server_3
+start all slaves;
+set default_master_connection = 'm1';
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = 'm2';
+--source include/wait_for_slave_to_start.inc
+
+set default_master_connection = 'm1';
+--let $master_pos= $master_pos_1
+--source include/sync_with_master_gtid.inc
+set default_master_connection = 'm2';
+--let $master_pos= $master_pos_2
+--source include/sync_with_master_gtid.inc
+
+--echo # cleanup
+--connection server_3
+set default_master_connection = 'm1';
+--source include/stop_slave.inc
+set default_master_connection = 'm2';
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set global gtid_domain_id= 0;
+reset master;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+
+--connection server_1
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+set global gtid_domain_id= 0;
+reset master;
+--connection server_2
+set global gtid_domain_id= 0;
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
+reset master;
+
+--disconnect server_1
+--disconnect server_2
+--disconnect server_3
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_bugs.test b/mysql-test/suite/rpl/t/rpl_start_alter_bugs.test
new file mode 100644
index 00000000000..52eef9fbb16
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_bugs.test
@@ -0,0 +1,47 @@
+#
+# MDEV-22985 Assertion `!(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans#
+#
+#
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection master
+set global binlog_alter_two_phase=true;
+
+--connection slave
+stop slave;
+SET global slave_parallel_threads=2;
+set global slave_parallel_mode=optimistic;
+start slave;
+--connection master
+
+CREATE TABLE t1 (i int primary key) ENGINE = InnoDB;
+--connection master1
+ALTER TABLE t1 DROP PRIMARY KEY;
+ALTER TABLE t1 ADD UNIQUE KEY ui (i);
+ALTER TABLE t1 ADD PRIMARY KEY (i);
+
+--sync_slave_with_master
+
+ #MENT 1274
+--connection master
+drop table t1;
+CREATE TABLE t1 (a int)engine=innodb;
+ALTER TABLE t1 add column b int, LOCK=EXCLUSIVE;
+drop table t1;
+CREATE TABLE t1 (pk int)engine=innodb;
+--error ER_CANT_DROP_FIELD_OR_KEY
+ALTER TABLE t1 DROP FOREIGN KEY y, LOCK=EXCLUSIVE;
+drop table t1;
+--sync_slave_with_master
+--connection master
+set global binlog_alter_two_phase=false;
+
+--connection slave
+--source include/stop_slave.inc
+SET global slave_parallel_threads=0;
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.cnf b/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.cnf
new file mode 100644
index 00000000000..498d8ed1096
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.cnf
@@ -0,0 +1,24 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+loose-innodb
+
+[mysqld.2]
+log-slave-updates
+loose-innodb
+
+[mysqld.3]
+log-slave-updates
+binlog_alter_two_phase=1
+loose-innodb
+
+[mysqld.4]
+loose-innodb
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
+
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYSOCK_4= @mysqld.4.socket
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.test b/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.test
new file mode 100644
index 00000000000..2c6f9c0fd72
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_chain_basic.test
@@ -0,0 +1,54 @@
+#
+# MENT-662 Lag Free alter for slave
+# In this we will see if chain replication works as
+# M->S(Legacy)->S(Parallel)->S(Legacy, without log-slave-upadates)
+#
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3->4
+--source include/rpl_init.inc
+
+--connection server_3
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+set global gtid_strict_mode=1;
+
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+set global slave_parallel_mode=optimistic;
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+
+--connection server_1
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase=ON;
+set binlog_alter_two_phase=ON;
+--let $engine=innodb
+--let $sync_slave= 1
+connect(master_node,127.0.0.1,root,,$db_name, $SERVER_MYPORT_1);
+connect(slave_node,127.0.0.1,root,,test, $SERVER_MYPORT_2);
+--source include/start_alter_basic.inc
+--disconnect master_node
+--disconnect slave_node
+--connection server_1
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase
+--source include/rpl_sync.inc
+
+
+--connection server_2
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+
+--connection server_3
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+--source include/start_slave.inc
+select @@slave_parallel_threads;
+
+--connection server_4
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_ftwrl.test b/mysql-test/suite/rpl/t/rpl_start_alter_ftwrl.test
new file mode 100644
index 00000000000..a8528cc6197
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_ftwrl.test
@@ -0,0 +1,91 @@
+#
+# MDEV-11675 Two phase ALTER binlogging
+#
+# Prove that FTWRL in the middle of START and "COMPLETE" parts of ALTER
+# is safe.
+
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection slave
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+--let $debug = `SELECT @@global.debug_dbug`
+
+--source include/stop_slave.inc
+
+SET @@global.slave_parallel_threads=4;
+SET @@global.slave_parallel_mode=optimistic;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+
+SET @@global.debug_dbug="+d,at_write_start_alter";
+--source include/start_slave.inc
+
+--connection master
+SET @@session.binlog_alter_two_phase=true;
+
+CREATE TABLE t1 (a INT) ENGINE=innodb;
+--source include/save_master_gtid.inc
+
+# Make sure the table exists on slave now.
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--connection master
+SET @@session.alter_algorithm='INSTANT';
+SET @@session.gtid_domain_id=11;
+ALTER TABLE t1 ADD COLUMN b int;
+
+
+--echo # START Alter having exclusive lock is waiting for the signal
+--connection slave
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now'
+--source include/wait_condition.inc
+
+--echo # FTWRL is sent first to wait for SA
+--connection slave1
+--send FLUSH TABLES WITH READ LOCK
+
+--echo # SA completes
+# First wait for the FTWRL arrival.
+--connection slave
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'FLUSH TABLES WITH READ LOCK' and STATE = 'Waiting for worker threads to pause for global read lock'
+--source include/wait_condition.inc
+
+set DEBUG_SYNC= "now signal alter_cont";
+
+--connection slave1
+--reap
+
+# Commit ALTER is hanging now
+--connection slave
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Slave_worker' AND STATE = 'Waiting for backup lock'
+--source include/wait_condition.inc
+
+--echo # Release CA
+--connection slave1
+UNLOCK TABLES;
+
+--connection master
+--sync_slave_with_master
+
+SHOW CREATE TABLE t1;
+--source include/show_binlog_events.inc
+
+--connection master
+DROP TABLE t1;
+
+--sync_slave_with_master
+
+--echo # cleanup
+--connection slave
+set DEBUG_SYNC = RESET;
+--source include/stop_slave.inc
+--eval set global slave_parallel_threads = $slave_parallel_threads
+--eval set global slave_parallel_mode = $slave_parallel_mode
+--eval set @@global.debug_dbug = "$debug"
+--source include/start_slave.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_instant.test b/mysql-test/suite/rpl/t/rpl_start_alter_instant.test
new file mode 100644
index 00000000000..ecb62e04fad
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_instant.test
@@ -0,0 +1,30 @@
+# MDEV-11675
+# Prove that "fast" ALTER options also combine with @@binlog_alter_two_phase.
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection master
+set binlog_alter_two_phase=true;
+CREATE OR REPLACE TABLE tab (
+ a int PRIMARY KEY,
+ b varchar(50),
+ c varchar(50)
+) CHARACTER SET=latin1 engine=innodb;
+
+SET SESSION alter_algorithm='INSTANT';
+ALTER TABLE tab MODIFY COLUMN b varchar(100);
+SET SESSION alter_algorithm='NOCOPY';
+ALTER TABLE tab MODIFY COLUMN c varchar(100);
+SHOW CREATE TABLE tab;
+--source include/show_binlog_events.inc
+
+--sync_slave_with_master
+SHOW CREATE TABLE tab;
+--source include/show_binlog_events.inc
+
+--connection master
+DROP TABLE tab;
+
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test
new file mode 100644
index 00000000000..5c78eb290c8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_1.test
@@ -0,0 +1,39 @@
+#
+# Start Alter with binlog applied using mysqlbinlog
+# single maser with only one domain id
+#
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--connection master
+set global binlog_alter_two_phase=true;
+--connection slave
+--source include/stop_slave.inc
+change master to master_use_gtid= current_pos;
+set global gtid_strict_mode=1;
+
+--echo # Legacy Master Slave
+--let $domain_1=0
+--let $domain_2=0
+--let $M_port= $MASTER_MYPORT
+--let $S_port= $SLAVE_MYPORT
+--let $sync_slave=0
+
+--source include/start_alter_include.inc
+--connection master
+--let $MYSQLD_DATADIR= `select @@datadir;`
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
+select @@gtid_binlog_state;
+RESET master;
+
+--connection slave
+--exec $MYSQL --host=127.0.0.1 --port=$SLAVE_MYPORT -e "source $MYSQLTEST_VARDIR/tmp/master.sql"
+select @@gtid_binlog_state;
+set global gtid_strict_mode=0;
+--source include/start_slave.inc
+
+--connection master
+set global binlog_alter_two_phase=false;
+remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.cnf b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.cnf
new file mode 100644
index 00000000000..a0f6dc5710c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.cnf
@@ -0,0 +1,19 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
+[mysqld.3]
+log-bin
+log-slave-updates
+
+
+[ENV]
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test
new file mode 100644
index 00000000000..c7d5bd66e2b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test
@@ -0,0 +1,164 @@
+#
+# MENT-662 Lag Free Alter On Slave
+#
+
+# Start Alter with Parallel Replication, With 2 sources
+# 2 domain id (From 2 sources)
+# |Concurrent alters| < |Parallel workers on slave|
+# |x| denotes number of entities it encloses
+# And then binary log from slave is replayed to slave again to check if
+# binlog output is okay.
+#
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+--connection server_1
+SET @save_binlog_alter_two_phase= @@GLOBAL.binlog_alter_two_phase;
+SET GLOBAL binlog_alter_two_phase = ON;
+SET binlog_alter_two_phase = ON;
+--echo # Create table and perform CA and RA
+CREATE TABLE t1( a INT, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1);
+INSERT INTO t1 VALUES(2,2);
+--echo # Normal Alter
+ALTER TABLE t1 ADD COLUMN c INT;
+--echo # Failed Alter
+INSERT INTO t1 VALUES(1,1, NULL);
+--error ER_DUP_ENTRY
+ALTER TABLE t1 CHANGE a a INT UNIQUE;
+SHOW CREATE TABLE t1;
+SELECT @@gtid_binlog_state;
+
+--echo # apply the binlog
+let MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master_1.sql
+DROP TABLE t1;
+--echo # reset the binlog
+RESET MASTER;
+
+--echo # execute the binlog
+--exec $MYSQL --port=$SERVER_MYPORT_1 --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/master_1.sql"
+SELECT @@gtid_binlog_state;
+--echo # Same as before
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+--echo # reset the binlog
+RESET MASTER;
+RESET SLAVE;
+remove_file $MYSQLTEST_VARDIR/tmp/master_1.sql;
+
+--connection server_2
+SET @save_binlog_alter_two_phase= @@GLOBAL.binlog_alter_two_phase;
+SET GLOBAL binlog_alter_two_phase = ON;
+
+--connection server_3
+SET @save_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
+SET @slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @slave_parallel_mode= @@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_threads=20;
+SET GLOBAL slave_parallel_mode=optimistic;
+SET GLOBAL gtid_strict_mode=1;
+
+--disable_warnings
+--disable_query_log
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval CHANGE MASTER 'm1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos;
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval CHANGE MASTER 'm2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos;
+--enable_query_log
+--enable_warnings
+
+--connection server_1
+SET gtid_domain_id= 11;
+CREATE DATABASE s1;
+USE s1;
+--let $domain_1=11
+--let $domain_2=11
+--let $M_port= $SERVER_MYPORT_1
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s1
+--source include/start_alter_include.inc
+
+--connection server_1
+DROP DATABASE s1;
+--let $master_pos_1= `SELECT @@gtid_binlog_pos`
+
+--connection server_2
+SET gtid_domain_id= 12;
+CREATE DATABASE s2;
+USE s2;
+--let $domain_1=12
+--let $domain_2=12
+--let $M_port= $SERVER_MYPORT_2
+--let $S_port= $SERVER_MYPORT_3
+--let $sync_slave=0
+--let $db_name=s2
+--source include/start_alter_include.inc
+--connection server_2
+DROP DATABASE s2;
+--let $master_pos_2= `SELECT @@gtid_binlog_pos`
+
+--connection server_3
+START ALL SLAVES;
+SET default_master_connection = 'm1';
+--source include/wait_for_slave_to_start.inc
+SET default_master_connection = 'm2';
+--source include/wait_for_slave_to_start.inc
+
+SET default_master_connection = 'm1';
+--let $master_pos= $master_pos_1
+--source include/sync_with_master_gtid.inc
+SET default_master_connection = 'm2';
+--let $master_pos= $master_pos_2
+--source include/sync_with_master_gtid.inc
+
+--echo # Stop slaves and apply binlog
+--connection server_3
+SET default_master_connection = 'm1';
+--source include/stop_slave.inc
+SET default_master_connection = 'm2';
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads = @slave_parallel_threads;
+SET GLOBAL slave_parallel_mode = @slave_parallel_mode;
+SET GLOBAL gtid_strict_mode = @save_gtid_strict_mode;
+SET GLOBAL gtid_domain_id= 0;
+SELECT @@gtid_binlog_state;
+
+let MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/slave_1.sql
+--echo # reset the binlog
+RESET MASTER;
+--echo # execute the binlog
+--exec $MYSQL --port=$SERVER_MYPORT_3 --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/slave_1.sql"
+SELECT @@gtid_binlog_state;
+
+--echo # One more time to simulate S->S case
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/slave_2.sql
+RESET MASTER;
+--echo # execute the binlog
+--exec $MYSQL --port=$SERVER_MYPORT_3 --host=127.0.0.1 -e "source $MYSQLTEST_VARDIR/tmp/slave_2.sql"
+SELECT @@gtid_binlog_state;
+remove_file $MYSQLTEST_VARDIR/tmp/slave_1.sql;
+remove_file $MYSQLTEST_VARDIR/tmp/slave_2.sql;
+RESET MASTER;
+RESET SLAVE ALL;
+SET GLOBAL gtid_slave_pos= '';
+
+--connection server_1
+SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase;
+SET GLOBAL gtid_domain_id= 0;
+RESET MASTER;
+--connection server_2
+SET GLOBAL gtid_domain_id= 0;
+SET GLOBAL binlog_alter_two_phase=@save_binlog_alter_two_phase;
+RESET MASTER;
+
+--disconnect server_1
+--disconnect server_2
+--disconnect server_3
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_optimize.test b/mysql-test/suite/rpl/t/rpl_start_alter_optimize.test
new file mode 100644
index 00000000000..528f2b52af7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_optimize.test
@@ -0,0 +1,25 @@
+# MDEV-11675 two phase logged ALTER
+#
+# The tests verifies execution of non-ALTER queries that are handled
+# through mysql_alter_table function.
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection master
+set binlog_alter_two_phase = ON;
+
+--connection master
+CREATE TABLE t1 (i int) engine=innodb;
+CREATE TABLE t2 (i int) engine=innodb;
+
+ALTER TABLE t1 DROP CONSTRAINT IF EXISTS y;
+OPTIMIZE TABLE t2;
+
+--sync_slave_with_master
+
+--connection master
+drop table t1,t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_options.test b/mysql-test/suite/rpl/t/rpl_start_alter_options.test
new file mode 100644
index 00000000000..12125b49122
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_options.test
@@ -0,0 +1,31 @@
+# This test will test all the option related to the Alter Table command
+# NOTE not all alter statements will follow alter_algorithm since for some statements
+# copy is only option
+# parameters
+# $alter_algorithm {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}
+# $show_binlog
+#
+
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--let $alter_algorithm= default
+#--let $show_binlog= false
+--source include/start_alter_options.inc
+
+--let $alter_algorithm= inplace
+--source include/start_alter_options.inc
+
+--let $alter_algorithm= copy
+--source include/start_alter_options.inc
+
+--echo # Prove formal support for nocopy and instant
+--let $alter_algorithm= instant
+--source include/start_alter_options.inc
+
+--let $alter_algorithm= nocopy
+--source include/start_alter_options.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_para_to_seq.test b/mysql-test/suite/rpl/t/rpl_start_alter_para_to_seq.test
new file mode 100644
index 00000000000..37e253139d2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_para_to_seq.test
@@ -0,0 +1,24 @@
+# MDEV-11675 binlog_alter_two_phase
+# MDEV-27511 Assertion `rgi->gtid_ev_flags_extra & Gtid_log_event::FL_COMMIT_ALTER_E1' failed
+# in write_bin_log_start_alter
+#
+--source include/have_log_bin.inc
+--source include/master-slave.inc
+
+# The test proves the assert is not hit anymore.
+--connection master
+CREATE TABLE t1 (a1 int, d1 int DEFAULT 0);
+INSERT INTO t1 VALUES (1,1) ;
+SET binlog_alter_two_phase = ON;
+ALTER TABLE t1 WAIT 9 RENAME COLUMN a1 TO a2;
+SET binlog_alter_two_phase = OFF;
+ALTER TABLE t1 ALTER COLUMN d1 DROP DEFAULT;
+
+--sync_slave_with_master
+
+# Cleanup
+--connection master
+drop table t1;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test
new file mode 100644
index 00000000000..eaddaa4db67
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test
@@ -0,0 +1,76 @@
+# Test crashing of master after writing start alter into binary log.
+# And the doing the same alter again, to test on slave if that is successful
+# ====> SA Crash SA CA Case
+#
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/no_valgrind_without_big.inc
+
+--connection slave
+SET @old_debug_slave= @@global.debug;
+stop slave;
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+start slave;
+
+--connection master
+call mtr.add_suppression("ALTER query started at .+ could not be completed");
+
+SET @old_debug_master= @@global.debug;
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set binlog_alter_two_phase=true;
+create table t3( a int primary key, b int) engine=innodb;
+
+--connection master
+--sync_slave_with_master
+--source include/stop_slave.inc
+
+
+--connection master
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+SET SESSION debug_dbug="d,start_alter_kill_after_binlog";
+--error 2013
+alter table t3 add column d int;
+
+--let $rpl_server_number= 1
+--source include/rpl_reconnect.inc
+set binlog_alter_two_phase= true;
+alter table t3 add column d int;
+show create table t3;
+--source include/show_binlog_events.inc
+--let $binlog_file=master-bin.000002
+--source include/show_binlog_events.inc
+--let $binlog_file=
+
+--connection slave
+--source include/start_slave.inc
+
+--connection master
+--sync_slave_with_master
+--source include/show_binlog_events.inc
+show create table t3;
+
+
+--connection master
+SET GLOBAL debug_dbug= @old_debug_master;
+drop table t3;
+--eval set global binlog_alter_two_phase = $binlog_alter_two_phase
+
+--sync_slave_with_master
+SET GLOBAL debug_dbug= @old_debug_slave;
+stop slave;
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+start slave;
+--connection master
+let MYSQLD_DATADIR= `select @@datadir;`;
+--remove_files_wildcard $MYSQLD_DATADIR/test #sql*.frm
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test
new file mode 100644
index 00000000000..df028ff1820
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test
@@ -0,0 +1,121 @@
+# This test will restart the slave in middle of start alter commit alter processing
+# slave will be restarted after start alter and before binlogging of commit alter,
+# Then we will recieved commit alter from the master.
+# Commit alter will act like standalone alter
+# =====> SA SA CA(Stop Slave before binlogging) CA
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_debug.inc
+
+--connection slave
+SET @old_debug_slave= @@global.debug;
+--source include/stop_slave.inc
+--let $gtid_strict_mode= `select @@gtid_strict_mode`
+--let $slave_parallel_threads= `select @@slave_parallel_threads`
+--let $slave_parallel_mode= `select @@slave_parallel_mode`
+SET GLOBAL slave_parallel_threads=4;
+set global slave_parallel_mode=optimistic;
+set global gtid_strict_mode=1;
+
+set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog";
+
+--source include/start_slave.inc
+#
+# SLAVE Shutdown
+--connection master
+SET @old_debug_master= @@global.debug;
+set global debug_dbug="+d,start_alter_delay_master";
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set global binlog_alter_two_phase=true;
+create table t1( a int primary key, b int) engine=myisam;
+create table t2( a int primary key, b int) engine=myisam;
+
+--connect (con1,localhost,root,,)
+--send alter table t1 add column c int;
+
+--connection master
+--echo # Get into binlog first and wait
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now';
+--source include/wait_condition.inc
+--let $master_gtid_state = `select @@gtid_binlog_state`
+--echo # master gtid state is $master_gtid_state
+
+--connect (con2,localhost,root,,)
+--send alter table t2 add column c int;
+
+--connection master
+--echo # Get into binlog next and wait as well
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now';
+--source include/wait_condition.inc
+--let $master_gtid_state = `select @@gtid_binlog_state`
+--echo # master gtid state is $master_gtid_state
+
+# Memorize for slave's next sync with master
+--let $master_pos=$master_gtid_state
+
+set DEBUG_SYNC= "now signal alter_cont";
+
+--connection con1
+--reap
+--connection con2
+--reap
+create table t3( a int primary key, b int) engine=innodb;
+--let $master_gtid_state = `select @@gtid_binlog_state`
+--echo # master gtid state is $master_gtid_state
+--let $replace_regexp=/alter table t[12]/alter table <t>/ /id=[0-9]+/id=<seq_no>/
+--source include/show_binlog_events2.inc
+
+--echo # Stop Slave
+--echo # As master binlog is SA SA CA CA
+--echo # let's stop at first CA processing (in process_commit_alter)
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+# set debug_sync="now wait_for CA_1_processing";
+connect(extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
+--send stop slave;
+--connection slave
+# set debug_sync="now signal proceed_CA_1";
+--connection extra_slave
+--reap
+SET GLOBAL debug_dbug= @old_debug_slave;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+--echo # The list of events after the slave has stopped must have just one CA:
+--let $replace_regexp=/alter table t[12]/alter table <t>/ /id=[0-9]+/id=<seq_no>/
+--source include/show_binlog_events2.inc
+
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+--echo # Everything from the master binlog must have been applied now:
+select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
+--let $slave_gtid_state = `select @@gtid_binlog_state`
+--echo # slave gtid state is $slave_gtid_state
+if (`select $master_gtid_state <> $slave_gtid_state`)
+{
+ --echo Gtid state mismatch: $master_gtid_state <> $slave_gtid_state
+ --die
+}
+--echo # The list of events after the slave has synchronized must have both CA:
+--let $replace_regexp=/alter table t[12]/alter table <t>/ /id=[0-9]+/id=<seq_no>/
+--source include/show_binlog_events2.inc
+
+--connection master
+drop table t1,t2,t3;
+--eval set global binlog_alter_two_phase = $binlog_alter_two_phase
+SET GLOBAL debug_dbug= @old_debug_master;
+set DEBUG_SYNC= 'RESET';
+
+--sync_slave_with_master
+stop slave;
+--eval set global slave_parallel_threads = $slave_parallel_threads;
+--eval set global slave_parallel_mode = $slave_parallel_mode;
+--eval set global gtid_strict_mode = $gtid_strict_mode;
+set DEBUG_SYNC= 'RESET';
+start slave;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index d864e615f7a..766acb14c3d 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -4,7 +4,7 @@
# This test case will test the condition of the bug#40013.
# The test step is:
# 1: create temp table on connection 'master';
-# 2: switch to ROW format using 'INSERT INTO t1 VALUES (UUID());'
+# 2: switch to ROW format using 'INSERT INTO t1 VALUES (SYS_GUID());'
# 3: disconnect 'master' and connect to a new connection 'master1';
# 4: sync to slave and check the number of temp tables on slave.
#
@@ -19,7 +19,7 @@ source include/master-slave.inc;
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
-INSERT INTO t1 VALUES (UUID());
+INSERT INTO t1 VALUES (SYS_GUID());
sync_slave_with_master;
@@ -188,7 +188,7 @@ DROP TEMPORARY TABLE t1;
--echo # The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
--disable_warnings
-INSERT IGNORE INTO t1 VALUES(uuid()+0);
+INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0);
--enable_warnings
COMMIT;
diff --git a/mysql-test/suite/s3/mysqldump.result b/mysql-test/suite/s3/mysqldump.result
index 5efde8415fb..3f4c2081388 100644
--- a/mysql-test/suite/s3/mysqldump.result
+++ b/mysql-test/suite/s3/mysqldump.result
@@ -23,7 +23,11 @@ CREATE TABLE `t1` (
PRIMARY KEY (`pk`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1,1),(2,2),(3,3),(4,4);
+INSERT INTO `t1` VALUES
+(1,1),
+(2,2),
+(3,3),
+(4,4);
ALTER TABLE `t1` ENGINE=S3;
#####
# mysqldump with --copy-s3-tables=1 XML
diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result
index 47b93eff7d1..0199bb7162f 100644
--- a/mysql-test/suite/sql_sequence/mysqldump.result
+++ b/mysql-test/suite/sql_sequence/mysqldump.result
@@ -14,7 +14,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables order 1
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
@@ -27,7 +29,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables order 2
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
@@ -40,7 +44,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables only tables
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -49,7 +55,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables only sequences
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
diff --git a/mysql-test/suite/sys_vars/r/binlog_alter_two_phase.result b/mysql-test/suite/sys_vars/r/binlog_alter_two_phase.result
new file mode 100644
index 00000000000..540d1b49458
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_alter_two_phase.result
@@ -0,0 +1,53 @@
+set binlog_alter_two_phase = OFF;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+0
+set binlog_alter_two_phase = ON;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+# wrong value
+set binlog_alter_two_phase=BINLOG_OY;
+ERROR 42000: Variable 'binlog_alter_two_phase' can't be set to the value of 'BINLOG_OY'
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+#true and false
+set binlog_alter_two_phase=false;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+0
+set binlog_alter_two_phase=true;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+set binlog_alter_two_phase=0;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+0
+set binlog_alter_two_phase=1;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+##wrong value
+set binlog_alter_two_phase=2;
+ERROR 42000: Variable 'binlog_alter_two_phase' can't be set to the value of '2'
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+#Global value
+set global binlog_alter_two_phase = OFF;
+connect con1,localhost,root,,;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+0
+disconnect con1;
+connection default;
+set global binlog_alter_two_phase = ON;
+connect con1,localhost,root,,;
+select @@binlog_alter_two_phase;
+@@binlog_alter_two_phase
+1
+disconnect con1;
+connection default;
+set global binlog_alter_two_phase=0;
diff --git a/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result
new file mode 100644
index 00000000000..19fae14579d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result
@@ -0,0 +1,102 @@
+#
+# MDEV-12914: Engine for temporary tables which are implicitly
+# created as RocksDB is substitued siliently with MyIsam
+SET default_tmp_storage_engine = engine_doesnt_exist;
+ERROR 42000: Unknown storage engine 'engine_doesnt_exist'
+SET default_tmp_storage_engine = rocksdb;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+SET default_tmp_storage_engine = CONCAT('rocks','db');
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+CREATE TABLE t1 (i int) ENGINE = RocksDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+DROP TABLE t1;
+SET default_storage_engine = DEFAULT;
+SET default_tmp_storage_engine = DEFAULT;
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE TEMPORARY TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1, t2;
+SET default_storage_engine = rocksdb;
+SET default_tmp_storage_engine = default;
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+CREATE TEMPORARY TABLE t2 (t int);
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+SET default_tmp_storage_engine = aria;
+CREATE TEMPORARY TABLE t2 (t int);
+DROP TABLE t2;
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+DROP TABLE t1;
+#
+# MDEV-26242: Assertion `i >= 0' failed on setting
+# default_tmp_storage_engine to 'DEFAULT' in 10.7
+#
+SHOW VARIABLES like '%storage_engine';
+Variable_name Value
+default_storage_engine ROCKSDB
+default_tmp_storage_engine Aria
+enforce_storage_engine
+storage_engine ROCKSDB
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+NULL MyISAM MyISAM Aria ROCKSDB ROCKSDB
+SELECT @@GLOBAL.table_type;
+ERROR HY000: Unknown system variable 'table_type'
+SET default_storage_engine=DEFAULT;
+SET default_tmp_storage_engine=innodb;
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+NULL MyISAM MyISAM InnoDB MyISAM MyISAM
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1, t;
+SET GLOBAL default_tmp_storage_engine='default';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+MyISAM MyISAM MyISAM InnoDB MyISAM MyISAM
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1, t;
+SET GLOBAL default_tmp_storage_engine=NULL;
diff --git a/mysql-test/suite/sys_vars/r/histogram_type_basic.result b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
index db42204ac1f..c24192002aa 100644
--- a/mysql-test/suite/sys_vars/r/histogram_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
@@ -1,11 +1,11 @@
SET @start_global_value = @@global.histogram_type;
SELECT @start_global_value;
@start_global_value
-DOUBLE_PREC_HB
+JSON_HB
SET @start_session_value = @@session.histogram_type;
SELECT @start_session_value;
@start_session_value
-DOUBLE_PREC_HB
+JSON_HB
SET @@global.histogram_type = 1;
SET @@global.histogram_type = DEFAULT;
SELECT @@global.histogram_type;
@@ -71,9 +71,9 @@ HISTOGRAM_TYPE DOUBLE_PREC_HB
SET @@global.histogram_type = @start_global_value;
SELECT @@global.histogram_type;
@@global.histogram_type
-DOUBLE_PREC_HB
+JSON_HB
SET @@session.histogram_type = @start_session_value;
SELECT @@session.histogram_type;
@@session.histogram_type
-DOUBLE_PREC_HB
+JSON_HB
set sql_mode='';
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result
deleted file mode 100644
index 5c9eb69de50..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result
+++ /dev/null
@@ -1,88 +0,0 @@
-SET @start_global_value = @@global.innodb_log_write_ahead_size;
-SET global innodb_log_write_ahead_size=4096;
-Valid values are positive number
-SELECT @@global.innodb_log_write_ahead_size >= 512;
-@@global.innodb_log_write_ahead_size >= 512
-1
-SELECT @@global.innodb_log_write_ahead_size <= 16*1024;
-@@global.innodb_log_write_ahead_size <= 16*1024
-1
-SELECT @@session.innodb_log_write_ahead_size;
-ERROR HY000: Variable 'innodb_log_write_ahead_size' is a GLOBAL variable
-SHOW global variables LIKE 'innodb_log_write_ahead_size';
-Variable_name Value
-innodb_log_write_ahead_size 4096
-SHOW session variables LIKE 'innodb_log_write_ahead_size';
-Variable_name Value
-innodb_log_write_ahead_size 4096
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LOG_WRITE_AHEAD_SIZE 4096
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LOG_WRITE_AHEAD_SIZE 4096
-SET global innodb_log_write_ahead_size=1024;
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-1024
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LOG_WRITE_AHEAD_SIZE 1024
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LOG_WRITE_AHEAD_SIZE 1024
-SET session innodb_log_write_ahead_size=2048;
-ERROR HY000: Variable 'innodb_log_write_ahead_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET global innodb_log_write_ahead_size=512;
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-512
-SET global innodb_log_write_ahead_size=2048;
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-2048
-SET global innodb_log_write_ahead_size=4096;
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-4096
-SET global innodb_log_write_ahead_size=0;
-Warnings:
-Warning 1292 Truncated incorrect innodb_log_write_ahead_size value: '0'
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-512
-SET global innodb_log_write_ahead_size=-1024;
-Warnings:
-Warning 1292 Truncated incorrect innodb_log_write_ahead_size value: '-1024'
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-512
-SET global innodb_log_write_ahead_size=3000;
-Warnings:
-Warning 1292 Truncated incorrect innodb_log_write_ahead_size value: '3000'
-Warning 1210 innodb_log_write_ahead_size should be set 2^n value and larger than 512.
-Warning 1210 Setting innodb_log_write_ahead_size to 4096
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-4096
-SET global innodb_log_write_ahead_size=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
-SET global innodb_log_write_ahead_size=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
-SET global innodb_log_write_ahead_size="foo";
-ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
-SET global innodb_log_write_ahead_size=-7;
-Warnings:
-Warning 1292 Truncated incorrect innodb_log_write_ahead_size value: '-7'
-SELECT @@global.innodb_log_write_ahead_size;
-@@global.innodb_log_write_ahead_size
-512
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_LOG_WRITE_AHEAD_SIZE 512
-SET @@global.innodb_log_write_ahead_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
index 2cb697acb6d..68d3d40091a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
@@ -6,9 +6,27 @@ SELECT COUNT(@@innodb_purge_threads);
COUNT(@@innodb_purge_threads)
1
1 Expected
+SET @save_threads = @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '-1'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+1
+SET @@GLOBAL.innodb_purge_threads=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '0'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+1
+SET @@GLOBAL.innodb_purge_threads=33;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '33'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+32
SET @@GLOBAL.innodb_purge_threads=1;
-ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
-Expected error 'Read-only variable'
+SET @@GLOBAL.innodb_purge_threads=32;
SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
Expected error 'Read-only variable'
@@ -38,4 +56,5 @@ SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'innodb_purge_threads';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_PURGE_THREADS 4
+INNODB_PURGE_THREADS 32
+SET GLOBAL innodb_purge_threads = @save_threads;
diff --git a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
index 01ad4659b46..f7889f3f7dd 100644
--- a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
@@ -8,23 +8,35 @@ SELECT @start_session_value;
0
'#--------------------FN_DYNVARS_054_01-------------------------#'
SET @@global.keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SET @@global.keep_files_on_create = DEFAULT;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
0
SET @@session.keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SET @@session.keep_files_on_create = DEFAULT;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
'#--------------------FN_DYNVARS_054_02-------------------------#'
SET @@global.keep_files_on_create = DEFAULT;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create = 'OFF';
@@global.keep_files_on_create = 'OFF'
1
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'OFF'
SET @@session.keep_files_on_create = DEFAULT;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create = 'OFF';
@@session.keep_files_on_create = 'OFF'
1
@@ -32,51 +44,75 @@ Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'OFF'
'#--------------------FN_DYNVARS_054_03-------------------------#'
SET @@global.keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
1
SET @@global.keep_files_on_create = OFF;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
0
SET @@global.keep_files_on_create = 0;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
0
SET @@global.keep_files_on_create = 1;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
1
SET @@global.keep_files_on_create = TRUE;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
1
SET @@global.keep_files_on_create = FALSE;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
0
'#--------------------FN_DYNVARS_054_04-------------------------#'
SET @@session.keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
1
SET @@session.keep_files_on_create = OFF;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
SET @@session.keep_files_on_create = 0;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
SET @@session.keep_files_on_create = 1;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
1
SET @@session.keep_files_on_create = TRUE;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
1
SET @@session.keep_files_on_create = FALSE;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
@@ -130,12 +166,18 @@ IF(@@session.keep_files_on_create, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_001_08----------------------#'
SET @@keep_files_on_create = OFF;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SET @@global.keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@keep_files_on_create = @@global.keep_files_on_create;
@@keep_files_on_create = @@global.keep_files_on_create
0
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@keep_files_on_create = ON;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@keep_files_on_create = @@local.keep_files_on_create;
@@keep_files_on_create = @@local.keep_files_on_create
1
@@ -144,6 +186,8 @@ SELECT @@local.keep_files_on_create = @@session.keep_files_on_create;
1
'#---------------------FN_DYNVARS_001_10----------------------#'
SET keep_files_on_create = 1;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@keep_files_on_create;
@@keep_files_on_create
1
@@ -154,10 +198,14 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT keep_files_on_create = @@session.keep_files_on_create;
ERROR 42S22: Unknown column 'keep_files_on_create' in 'field list'
SET @@global.keep_files_on_create = @start_global_value;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@global.keep_files_on_create;
@@global.keep_files_on_create
0
SET @@session.keep_files_on_create = @start_session_value;
+Warnings:
+Warning 1287 '@@keep_files_on_create' is deprecated and will be removed in a future release
SELECT @@session.keep_files_on_create;
@@session.keep_files_on_create
0
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
index 7a524ba2c16..3c6f2c3b8d9 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -18,14 +18,14 @@
NUMERIC_MAX_VALUE 2
@@ -85,10 +85,10 @@
SESSION_VALUE NULL
- DEFAULT_VALUE 134217728
+ DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
- NUMERIC_MIN_VALUE 1048576
--NUMERIC_MAX_VALUE 9223372036854775807
-+NUMERIC_MAX_VALUE 2147483647
+ VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means autosize this variable based on buffer pool size.
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1048576
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -65,7 +65,7 @@
VARIABLE_COMMENT Percentage of empty space on a data page that can be reserved to make the page compressible.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 75
-@@ -649,7 +649,7 @@
+@@ -625,7 +625,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 600
VARIABLE_SCOPE GLOBAL
@@ -74,7 +74,7 @@
VARIABLE_COMMENT Maximum number of seconds that semaphore times out in InnoDB.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -697,7 +697,7 @@
+@@ -673,7 +673,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -83,7 +83,7 @@
VARIABLE_COMMENT Number of iterations over which the background flushing is averaged.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1000
-@@ -721,7 +721,7 @@
+@@ -697,7 +697,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -92,7 +92,7 @@
VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 3
-@@ -745,7 +745,7 @@
+@@ -721,7 +721,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
@@ -101,7 +101,7 @@
VARIABLE_COMMENT Set to 0 (don't flush neighbors from buffer pool), 1 (flush contiguous neighbors from buffer pool) or 2 (flush neighbors from buffer pool), when flushing a block
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -781,7 +781,7 @@
+@@ -757,7 +757,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -110,7 +110,7 @@
VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt. Value 5 can return bogus data, and 6 can permanently corrupt data.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 6
-@@ -805,10 +805,10 @@
+@@ -781,10 +781,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8000000
VARIABLE_SCOPE GLOBAL
@@ -123,7 +123,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -841,7 +841,7 @@
+@@ -817,7 +817,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 84
VARIABLE_SCOPE GLOBAL
@@ -132,7 +132,7 @@
VARIABLE_COMMENT InnoDB Fulltext search maximum token size in characters
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
-@@ -853,7 +853,7 @@
+@@ -829,7 +829,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 3
VARIABLE_SCOPE GLOBAL
@@ -141,7 +141,7 @@
VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16
-@@ -865,7 +865,7 @@
+@@ -841,7 +841,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
@@ -150,7 +150,7 @@
VARIABLE_COMMENT InnoDB Fulltext search number of words to optimize for each optimize table call
NUMERIC_MIN_VALUE 1000
NUMERIC_MAX_VALUE 10000
-@@ -877,10 +877,10 @@
+@@ -853,10 +853,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2000000000
VARIABLE_SCOPE GLOBAL
@@ -163,7 +163,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -901,7 +901,7 @@
+@@ -877,7 +877,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -172,7 +172,7 @@
VARIABLE_COMMENT InnoDB Fulltext search parallel sort degree, will round up to nearest power of 2 number
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 16
-@@ -913,10 +913,10 @@
+@@ -889,10 +889,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 640000000
VARIABLE_SCOPE GLOBAL
@@ -185,7 +185,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -961,22 +961,22 @@
+@@ -937,22 +937,22 @@
SESSION_VALUE NULL
DEFAULT_VALUE 200
VARIABLE_SCOPE GLOBAL
@@ -213,29 +213,20 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1009,10 +1009,10 @@
+@@ -985,10 +985,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16777216
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT The size of the buffer which InnoDB uses to write log to the log files on disk.
- NUMERIC_MIN_VALUE 262144
--NUMERIC_MAX_VALUE 9223372036854775807
-+NUMERIC_MAX_VALUE 2147483647
- NUMERIC_BLOCK_SIZE 1024
+ VARIABLE_COMMENT Redo log buffer size in bytes.
+ NUMERIC_MIN_VALUE 2097152
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -1057,7 +1057,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 8192
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
- NUMERIC_MIN_VALUE 512
- NUMERIC_MAX_VALUE 16384
-@@ -1069,10 +1069,10 @@
+@@ -1033,10 +1033,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 32
VARIABLE_SCOPE GLOBAL
@@ -248,7 +239,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1081,10 +1081,10 @@
+@@ -1045,10 +1045,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1536
VARIABLE_SCOPE GLOBAL
@@ -261,7 +252,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1129,10 +1129,10 @@
+@@ -1081,10 +1081,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -274,7 +265,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1141,7 +1141,7 @@
+@@ -1093,7 +1093,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -283,7 +274,7 @@
VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 10000000
-@@ -1273,10 +1273,10 @@
+@@ -1225,10 +1225,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -296,7 +287,7 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -1309,7 +1309,7 @@
+@@ -1249,7 +1249,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 16384
VARIABLE_SCOPE GLOBAL
@@ -305,7 +296,7 @@
VARIABLE_COMMENT Page size to use for all InnoDB tablespaces.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 65536
-@@ -1345,7 +1345,7 @@
+@@ -1285,7 +1285,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
@@ -314,7 +305,7 @@
VARIABLE_COMMENT Number of UNDO log pages to purge in one batch from the history list.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5000
-@@ -1357,7 +1357,7 @@
+@@ -1297,7 +1297,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -323,7 +314,7 @@
VARIABLE_COMMENT Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -1393,7 +1393,7 @@
+@@ -1333,7 +1333,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 56
VARIABLE_SCOPE GLOBAL
@@ -332,7 +323,7 @@
VARIABLE_COMMENT Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
-@@ -1465,7 +1465,7 @@
+@@ -1405,7 +1405,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -341,7 +332,7 @@
VARIABLE_COMMENT Memory buffer size for index creation
NUMERIC_MIN_VALUE 65536
NUMERIC_MAX_VALUE 67108864
-@@ -1633,10 +1633,10 @@
+@@ -1573,10 +1573,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
@@ -354,12 +345,3 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1729,7 +1729,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Number of undo tablespaces to use.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 127
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 8727d66f59b..c3dd970f6e3 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -5,6 +5,7 @@ variable_name not in (
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_evict_tables_on_commit_debug', # one may want to override this
'innodb_use_native_aio', # default value depends on OS
+'innodb_log_file_buffering', # only available on Linux and Windows
'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing
order by variable_name;
VARIABLE_NAME INNODB_ADAPTIVE_FLUSHING
@@ -81,12 +82,12 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BUFFER_POOL_CHUNK_SIZE
SESSION_VALUE NULL
-DEFAULT_VALUE 134217728
+DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
-NUMERIC_MIN_VALUE 1048576
-NUMERIC_MAX_VALUE 9223372036854775807
+VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means autosize this variable based on buffer pool size.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1048576
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -984,10 +985,10 @@ SESSION_VALUE NULL
DEFAULT_VALUE 16777216
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT The size of the buffer which InnoDB uses to write log to the log files on disk.
-NUMERIC_MIN_VALUE 262144
-NUMERIC_MAX_VALUE 9223372036854775807
-NUMERIC_BLOCK_SIZE 1024
+VARIABLE_COMMENT Redo log buffer size in bytes.
+NUMERIC_MIN_VALUE 2097152
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
@@ -1008,10 +1009,10 @@ SESSION_VALUE NULL
DEFAULT_VALUE 100663296
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Size of each log file in a log group.
-NUMERIC_MIN_VALUE 1048576
+VARIABLE_COMMENT Redo log size in bytes.
+NUMERIC_MIN_VALUE 4194304
NUMERIC_MAX_VALUE 18446744073709551615
-NUMERIC_BLOCK_SIZE 65536
+NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
@@ -1020,25 +1021,13 @@ SESSION_VALUE NULL
DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT Path to InnoDB log files.
+VARIABLE_COMMENT Path to ib_logfile0
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_LOG_WRITE_AHEAD_SIZE
-SESSION_VALUE NULL
-DEFAULT_VALUE 8192
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
-NUMERIC_MIN_VALUE 512
-NUMERIC_MAX_VALUE 16384
-NUMERIC_BLOCK_SIZE 512
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LRU_FLUSH_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 32
@@ -1325,7 +1314,7 @@ NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 32
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
-READ_ONLY YES
+READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_RANDOM_READ_AHEAD
SESSION_VALUE NULL
@@ -1679,7 +1668,7 @@ VARIABLE_NAME INNODB_UNDO_TABLESPACES
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Number of undo tablespaces to use.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 127
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 3eb3f52bd0f..29e5d03dd98 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -1205,11 +1205,11 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME HISTOGRAM_TYPE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Specifies type of the histograms created by ANALYZE. Possible values are: SINGLE_PREC_HB - single precision height-balanced, DOUBLE_PREC_HB - double precision height-balanced.
+VARIABLE_COMMENT Specifies type of the histograms created by ANALYZE. Possible values are: SINGLE_PREC_HB - single precision height-balanced, DOUBLE_PREC_HB - double precision height-balanced, JSON_HB - height-balanced, stored as JSON.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB
+ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB,JSON_HB
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME HOSTNAME
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index ff87672bfa3..f0dda77da15 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -322,6 +322,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_ALTER_TWO_PHASE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT When set, split ALTER at binary logging into 2 statements: START ALTER and COMMIT/ROLLBACK ALTER
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BINLOG_ANNOTATE_ROW_EVENTS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
@@ -1305,11 +1315,11 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME HISTOGRAM_TYPE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Specifies type of the histograms created by ANALYZE. Possible values are: SINGLE_PREC_HB - single precision height-balanced, DOUBLE_PREC_HB - double precision height-balanced.
+VARIABLE_COMMENT Specifies type of the histograms created by ANALYZE. Possible values are: SINGLE_PREC_HB - single precision height-balanced, DOUBLE_PREC_HB - double precision height-balanced, JSON_HB - height-balanced, stored as JSON.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB
+ENUM_VALUE_LIST SINGLE_PREC_HB,DOUBLE_PREC_HB,JSON_HB
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME HOSTNAME
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
index 6c584e190f1..ae7cce823ef 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@ -526,21 +526,6 @@ ENUM_VALUE_LIST NONE,ALL,ALL_KILL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME WSREP_REPLICATE_MYISAM
-SESSION_VALUE NULL
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT To enable myisam replication
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_RESTART_SLAVE
SESSION_VALUE NULL
GLOBAL_VALUE OFF
@@ -721,21 +706,6 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME WSREP_STRICT_DDL
-SESSION_VALUE NULL
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT If set, reject DDL on affected tables not supporting Galera replication
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_SYNC_WAIT
SESSION_VALUE 0
GLOBAL_VALUE 0
diff --git a/mysql-test/suite/sys_vars/t/binlog_alter_two_phase.test b/mysql-test/suite/sys_vars/t/binlog_alter_two_phase.test
new file mode 100644
index 00000000000..bc3adf12c15
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_alter_two_phase.test
@@ -0,0 +1,52 @@
+#
+# binlog_alter_two_phase system variable
+# Session as well as global
+# Allowed values NO_SPLIT, SPLIT, BINLOG_ONLY (0,1,2)
+
+--source include/not_embedded.inc
+
+--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
+set binlog_alter_two_phase = OFF;
+select @@binlog_alter_two_phase;
+
+set binlog_alter_two_phase = ON;
+select @@binlog_alter_two_phase;
+
+--echo # wrong value
+--error ER_WRONG_VALUE_FOR_VAR
+set binlog_alter_two_phase=BINLOG_OY;
+select @@binlog_alter_two_phase;
+
+--echo #true and false
+set binlog_alter_two_phase=false;
+select @@binlog_alter_two_phase;
+
+set binlog_alter_two_phase=true;
+select @@binlog_alter_two_phase;
+
+set binlog_alter_two_phase=0;
+select @@binlog_alter_two_phase;
+
+set binlog_alter_two_phase=1;
+select @@binlog_alter_two_phase;
+
+--echo ##wrong value
+--error ER_WRONG_VALUE_FOR_VAR
+set binlog_alter_two_phase=2;
+select @@binlog_alter_two_phase;
+
+
+--echo #Global value
+set global binlog_alter_two_phase = OFF;
+connect (con1,localhost,root,,);
+select @@binlog_alter_two_phase;
+disconnect con1;
+
+connection default;
+set global binlog_alter_two_phase = ON;
+connect (con1,localhost,root,,);
+select @@binlog_alter_two_phase;
+disconnect con1;
+
+connection default;
+--eval set global binlog_alter_two_phase=$binlog_alter_two_phase
diff --git a/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test
new file mode 100644
index 00000000000..3454e5d6fc4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test
@@ -0,0 +1,86 @@
+--echo #
+--echo # MDEV-12914: Engine for temporary tables which are implicitly
+--echo # created as RocksDB is substitued siliently with MyIsam
+
+--source include/have_rocksdb.inc
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+SET default_tmp_storage_engine = engine_doesnt_exist;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+SET default_tmp_storage_engine = rocksdb;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+SET default_tmp_storage_engine = CONCAT('rocks','db');
+
+CREATE TABLE t1 (i int) ENGINE = RocksDB;
+SHOW CREATE TABLE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DROP TABLE t1;
+
+SET default_storage_engine = DEFAULT;
+SET default_tmp_storage_engine = DEFAULT;
+
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+CREATE TEMPORARY TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+
+DROP TABLE t1, t2;
+
+SET default_storage_engine = rocksdb;
+# setting default or null for tmp SE should use default SE
+SET default_tmp_storage_engine = default;
+
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 (t int);
+
+SET default_tmp_storage_engine = aria;
+CREATE TEMPORARY TABLE t2 (t int);
+DROP TABLE t2;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26242: Assertion `i >= 0' failed on setting
+--echo # default_tmp_storage_engine to 'DEFAULT' in 10.7
+--echo #
+
+
+SHOW VARIABLES like '%storage_engine';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@GLOBAL.table_type;
+
+SET default_storage_engine=DEFAULT;
+SET default_tmp_storage_engine=innodb;
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+SHOW CREATE TABLE t1;
+DROP TABLE t1, t;
+
+SET GLOBAL default_tmp_storage_engine='default';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+SHOW CREATE TABLE t1;
+DROP TABLE t1, t;
+
+SET GLOBAL default_tmp_storage_engine=NULL; \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
index f37e3e2e0fd..dada2a9a455 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
@@ -25,7 +25,7 @@
--source include/have_innodb.inc
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+ SELECT SUBSTR(variable_value, 1, 30) = 'Completed resizing buffer pool'
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test
deleted file mode 100644
index 8693c6a7b1b..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test
+++ /dev/null
@@ -1,93 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_log_write_ahead_size;
-
-# default value is limited by innodb_page_size and varying along with the page size.
-#SELECT @start_global_value;
-
-#set common valid value
-SET global innodb_log_write_ahead_size=4096;
-
-#
-# exists as global only
-#
---echo Valid values are positive number
-SELECT @@global.innodb_log_write_ahead_size >= 512;
-SELECT @@global.innodb_log_write_ahead_size <= 16*1024;
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_log_write_ahead_size;
-SHOW global variables LIKE 'innodb_log_write_ahead_size';
-SHOW session variables LIKE 'innodb_log_write_ahead_size';
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_log_write_ahead_size';
---enable_warnings
-
-#
-# show that it's writable
-#
-SET global innodb_log_write_ahead_size=1024;
-SELECT @@global.innodb_log_write_ahead_size;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
-SELECT * FROM information_schema.session_variables
-WHERE variable_name='innodb_log_write_ahead_size';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-SET session innodb_log_write_ahead_size=2048;
-
-#
-# Valid values
-#
-SET global innodb_log_write_ahead_size=512;
-SELECT @@global.innodb_log_write_ahead_size;
-SET global innodb_log_write_ahead_size=2048;
-SELECT @@global.innodb_log_write_ahead_size;
-SET global innodb_log_write_ahead_size=4096;
-SELECT @@global.innodb_log_write_ahead_size;
-
-# limited by innodb_page_size, and the followings are occationally invalid
-#SET global innodb_log_write_ahead_size=8192;
-#SELECT @@global.innodb_log_write_ahead_size;
-#SET global innodb_log_write_ahead_size=16384;
-#SELECT @@global.innodb_log_write_ahead_size;
-
-#
-# Invalid values
-#
-SET global innodb_log_write_ahead_size=0;
-SELECT @@global.innodb_log_write_ahead_size;
-SET global innodb_log_write_ahead_size=-1024;
-SELECT @@global.innodb_log_write_ahead_size;
-SET global innodb_log_write_ahead_size=3000;
-SELECT @@global.innodb_log_write_ahead_size;
-
-# limited by innodb_page_size, and the followings result occationally different
-#SET global innodb_log_write_ahead_size=32768;
-#SELECT @@global.innodb_log_write_ahead_size;
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_log_write_ahead_size=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_log_write_ahead_size=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-SET global innodb_log_write_ahead_size="foo";
-SET global innodb_log_write_ahead_size=-7;
-SELECT @@global.innodb_log_write_ahead_size;
---disable_warnings
-SELECT * FROM information_schema.global_variables
-WHERE variable_name='innodb_log_write_ahead_size';
---enable_warnings
-
-#
-# cleanup
-#
-
-SET @@global.innodb_log_write_ahead_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
index 4d039601e40..1156fa40a4a 100644
--- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
@@ -11,9 +11,17 @@ SELECT COUNT(@@GLOBAL.innodb_purge_threads);
SELECT COUNT(@@innodb_purge_threads);
--echo 1 Expected
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @save_threads = @@GLOBAL.innodb_purge_threads;
+
+SET @@GLOBAL.innodb_purge_threads=-1;
+SELECT @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=0;
+SELECT @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=33;
+SELECT @@GLOBAL.innodb_purge_threads;
+
SET @@GLOBAL.innodb_purge_threads=1;
---echo Expected error 'Read-only variable'
+SET @@GLOBAL.innodb_purge_threads=32;
--Error ER_BAD_FIELD_ERROR
SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
@@ -51,3 +59,5 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'innodb_purge_threads';
--enable_warnings
+
+SET GLOBAL innodb_purge_threads = @save_threads;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
index 15fd99e9984..6d46c22683f 100644
--- a/mysql-test/suite/sys_vars/t/sysvars_innodb.test
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
@@ -12,5 +12,6 @@ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYP
'innodb_numa_interleave', # only available WITH_NUMA
'innodb_evict_tables_on_commit_debug', # one may want to override this
'innodb_use_native_aio', # default value depends on OS
+ 'innodb_log_file_buffering', # only available on Linux and Windows
'innodb_buffer_pool_load_pages_abort') # debug build only, and is only for testing
order by variable_name;
diff --git a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
index df084f8c1a5..c7bb029da39 100644
--- a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
+++ b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
@@ -131,7 +131,7 @@ CALL sys.statement_performance_analyzer('do magic', NULL, NULL);
ERROR 45000: Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot
SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
CALL sys.statement_performance_analyzer('do magic', NULL, NULL);
-ERROR 01000: Data truncated for column 'in_action' at row 1
+ERROR 01000: Data truncated for column 'in_action' at row 0
CALL sys.statement_performance_analyzer('create_tmp', 'sys.tmp_digests', NULL);
ERROR 45000: Invalid value for in_table: `sys`.`tmp_digests` is reserved table name.
CALL sys.statement_performance_analyzer('create_tmp', 'sys.tmp_digests_delta', NULL);
@@ -187,7 +187,7 @@ DROP TEMPORARY TABLE sys.tmp_digests_delta;
ERROR 42S02: Unknown table 'sys.tmp_digests_delta'
SET @identifier := REPEAT('a', 65);
CALL sys.statement_performance_analyzer('snapshot', CONCAT(@identifier, '.', @identifier), NULL);
-ERROR 22001: Data too long for column 'in_table' at row 1
+ERROR 22001: Data too long for column 'in_table' at row 0
DROP TEMPORARY TABLE test.tmp_digests_ini;
DROP TEMPORARY TABLE test.tmp_digests;
DROP TABLE test.tmp_unsupported;
diff --git a/mysql-test/suite/sysschema/r/pr_table_exists.result b/mysql-test/suite/sysschema/r/pr_table_exists.result
index 88917418f67..76085bd72dd 100644
--- a/mysql-test/suite/sysschema/r/pr_table_exists.result
+++ b/mysql-test/suite/sysschema/r/pr_table_exists.result
@@ -40,7 +40,7 @@ SET @identifier := REPEAT('a', 65);
CALL sys.table_exists(@identifier, 't1', @exists);
ERROR 22001: Data too long for column 'in_db' at row 1
CALL sys.table_exists('test', @identifier, @exists);
-ERROR 22001: Data too long for column 'in_table' at row 1
+ERROR 22001: Data too long for column 'in_table' at row 0
SET @identifier := NULL;
#
# MDEV-28391: table_exists procedure fails with
diff --git a/mysql-test/suite/vcol/r/binlog.result b/mysql-test/suite/vcol/r/binlog.result
index 9fd1f9e5b9d..1f66a632697 100644
--- a/mysql-test/suite/vcol/r/binlog.result
+++ b/mysql-test/suite/vcol/r/binlog.result
@@ -88,7 +88,7 @@ CREATE TEMPORARY TABLE t1 SELECT UUID();
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
- `UUID()` varchar(36) DEFAULT NULL
+ `UUID()` uuid DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
CREATE TABLE t2 (a INT PRIMARY KEY, b TEXT, c INT GENERATED ALWAYS AS(b));
INSERT INTO t2 (a,b) VALUES (1,1);
diff --git a/mysql-test/suite/versioning/r/data.result b/mysql-test/suite/versioning/r/data.result
new file mode 100644
index 00000000000..7fea6c3d06e
--- /dev/null
+++ b/mysql-test/suite/versioning/r/data.result
@@ -0,0 +1,59 @@
+#
+# MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables
+#
+create or replace table t1 (x int) with system versioning;
+set timestamp=unix_timestamp('1990-01-01 00:00');
+insert t1 (x) values (1),(2),(3);
+set timestamp=unix_timestamp('1990-08-03 00:00');
+delete from t1 where x=1;
+set timestamp=unix_timestamp('1991-01-02 00:00');
+delete from t1 where x=2;
+set timestamp=default;
+#MYSQL_DUMP --compact test
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(3);
+#MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
+
+USE `test`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+mariadb-dump: Incorrect DATETIME value: '1990-08-04 00:00' where 'abc'
+drop tables t1;
diff --git a/mysql-test/suite/versioning/r/partition,heap.rdiff b/mysql-test/suite/versioning/r/partition,heap.rdiff
new file mode 100644
index 00000000000..361a74a4271
--- /dev/null
+++ b/mysql-test/suite/versioning/r/partition,heap.rdiff
@@ -0,0 +1,86 @@
+@@ -1969,85 +1969,6 @@
+ (PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+ drop tables t1, tp1;
+-# Complex table
+-create or replace table t1 (
+-x int primary key auto_increment,
+-t timestamp(6) default '2001-11-11 11:11:11',
+-b blob(4096) compressed null,
+-c varchar(1033) character set utf8 not null,
+-u int,
+-unique key (x, u),
+-m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+-i1 tinyint, i2 smallint, i3 bigint,
+-index three(i1, i2, i3),
+-v1 timestamp(6) generated always as (t + interval 1 day),
+-v2 timestamp(6) generated always as (t + interval 1 month) stored,
+-s timestamp(6) as row start,
+-e timestamp(6) as row end,
+-period for system_time (s, e),
+-ps date, pe date,
+-period for app_time (ps, pe),
+-constraint check_constr check (u > -1))
+-with system versioning default charset=ucs2
+-partition by range(x) (
+-partition p0 values less than (10),
+-partition p1 values less than (20),
+-partition pn values less than maxvalue);
+-alter table t1 convert partition p1 to table tp1;
+-show create table tp1;
+-Table Create Table
+-tp1 CREATE TABLE `tp1` (
+- `x` int(11) NOT NULL AUTO_INCREMENT,
+- `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+- `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+- `c` varchar(1033) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+- `u` int(11) DEFAULT NULL,
+- `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+- `i1` tinyint(4) DEFAULT NULL,
+- `i2` smallint(6) DEFAULT NULL,
+- `i3` bigint(20) DEFAULT NULL,
+- `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+- `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+- `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+- `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+- `ps` date NOT NULL,
+- `pe` date NOT NULL,
+- PERIOD FOR `app_time` (`ps`, `pe`),
+- PRIMARY KEY (`x`,`e`),
+- UNIQUE KEY `x` (`x`,`u`,`e`),
+- KEY `three` (`i1`,`i2`,`i3`),
+- PERIOD FOR SYSTEM_TIME (`s`, `e`),
+- CONSTRAINT `check_constr` CHECK (`u` > -1)
+-) ENGINE=X DEFAULT CHARSET=ucs2 COLLATE=ucs2_general_ci WITH SYSTEM VERSIONING
+-show create table t1;
+-Table Create Table
+-t1 CREATE TABLE `t1` (
+- `x` int(11) NOT NULL AUTO_INCREMENT,
+- `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+- `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+- `c` varchar(1033) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+- `u` int(11) DEFAULT NULL,
+- `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+- `i1` tinyint(4) DEFAULT NULL,
+- `i2` smallint(6) DEFAULT NULL,
+- `i3` bigint(20) DEFAULT NULL,
+- `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+- `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+- `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+- `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+- `ps` date NOT NULL,
+- `pe` date NOT NULL,
+- PERIOD FOR `app_time` (`ps`, `pe`),
+- PRIMARY KEY (`x`,`e`),
+- UNIQUE KEY `x` (`x`,`u`,`e`),
+- KEY `three` (`i1`,`i2`,`i3`),
+- PERIOD FOR SYSTEM_TIME (`s`, `e`),
+- CONSTRAINT `check_constr` CHECK (`u` > -1)
+-) ENGINE=X DEFAULT CHARSET=ucs2 COLLATE=ucs2_general_ci WITH SYSTEM VERSIONING
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p0` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+-drop tables t1, tp1;
+ #
+ # End of 10.7 tests
+ #
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index b8ad7693f51..6feee27818b 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -96,6 +96,16 @@ with system versioning
partition by system_time (
partition p0 history,
partition pn current);
+create or replace table t1 (a int)
+partition by range (a) (
+partition p0 history,
+partition p1 current);
+ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE`
+create or replace table t1 (b int)
+partition by range (a) (
+partition p0 current,
+partition p1 history);
+ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE`
## ALTER TABLE
alter table t1 add partition (
partition p1 current);
@@ -150,7 +160,7 @@ partition by system_time limit 1;
alter table t1 change x big int;
create or replace table t1 (i int) engine myisam partition by hash(i) partitions 2;
alter table t1 add partition (partition px history);
-ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
+ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `HASH`
## INSERT, UPDATE, DELETE
create or replace table t1 (x int)
with system versioning
@@ -253,7 +263,7 @@ t1 CREATE TABLE `t1` (
PARTITION BY SYSTEM_TIME LIMIT 2
PARTITIONS 3
alter table t1 drop partition non_existent;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
insert into t1 values (1), (2), (3), (4), (5), (6);
select * from t1 partition (pn);
x
@@ -1105,7 +1115,7 @@ drop table t1;
create table t1 (a int) with system versioning partition by system_time
(partition p1 history, partition pn current);
alter table t1 add partition (partition p2);
-ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
+ERROR HY000: Wrong partition type `HASH` for partitioning by `SYSTEM_TIME`
# MDEV-17891 Assertion failures in select_insert::abort_result_set and
# mysql_load upon attempt to replace into a full table
set @@max_heap_table_size= 1024*1024;
@@ -1741,6 +1751,7 @@ drop tables t1;
#
# MDEV-22155 ALTER add default history partitions name clash on non-default partitions
#
+set timestamp= default;
create or replace table t1 (x int) with system versioning
partition by system_time limit 1
(partition p2 history, partition p8 history, partition pn current);
@@ -1783,4 +1794,382 @@ drop tables t1;
#
# End of 10.5 tests
#
+#
+# MDEV-22166 MIGRATE PARTITION: move out partition into a table
+#
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+update t1 set x= x + 1;
+alter table t1 convert partition p2 to table tp2;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from tp2;
+x
+13
+select * from tp2 for system_time all order by x;
+x
+12
+13
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+23
+33
+43
+53
+select * from t1 for system_time all order by x;
+x
+2
+3
+22
+23
+32
+33
+42
+43
+52
+53
+# SP
+create or replace procedure sp()
+alter table t1 convert partition p3 to table tp3;
+call sp;
+show create table tp3;
+Table Create Table
+tp3 CREATE TABLE `tp3` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from tp3;
+x
+23
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+33
+43
+53
+drop table tp3;
+call sp;
+ERROR HY000: Wrong partition name or partition list
+call sp;
+ERROR HY000: Wrong partition name or partition list
+drop procedure sp;
+# LOCK TABLES, PS, SP
+create or replace procedure sp()
+alter table t1 convert partition p4 to table tp4;
+lock tables t1 write;
+prepare stmt from 'call sp';
+execute stmt;
+unlock tables;
+show create table tp4;
+Table Create Table
+tp4 CREATE TABLE `tp4` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from tp4;
+x
+33
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+43
+53
+drop table tp4;
+lock tables t1 write;
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+call sp;
+ERROR HY000: Wrong partition name or partition list
+drop prepare stmt;
+unlock tables;
+drop procedure sp;
+unlock tables;
+drop tables t1, tp2;
+# System-versioned tables (SYSTEM_TIME LIMIT)
+create or replace table t1 (
+x int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time limit 1 partitions 4;
+insert into t1 values (2), (12), (22);
+update t1 set x= x + 1 where x = 2;
+update t1 set x= x + 1 where x = 12;
+update t1 set x= x + 1 where x = 22;
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p2`) is out of LIMIT, need more HISTORY partitions
+select * from t1 partition (p1);
+x
+12
+alter table t1 convert partition pn to table tp1;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from tp1;
+x
+select * from tp1 for system_time all;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME LIMIT 1
+(PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `p2` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+select * from t1 order by x;
+x
+3
+13
+23
+select * from t1 for system_time all order by x;
+x
+2
+3
+13
+22
+23
+drop tables t1, tp1;
+# System-versioned tables (SYSTEM_TIME INTERVAL)
+set timestamp= unix_timestamp('2000-01-01 00:00:00');
+create or replace table t1 (
+x int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time interval 1 hour partitions 4;
+insert into t1 values (2), (12), (22);
+set timestamp= unix_timestamp('2000-01-01 00:00:01');
+update t1 set x= x + 1 where x = 2;
+set timestamp= unix_timestamp('2000-01-01 01:00:00');
+update t1 set x= x + 1 where x = 12;
+set timestamp= unix_timestamp('2000-01-01 02:00:00');
+update t1 set x= x + 1 where x = 22;
+select * from t1 partition (p0);
+x
+2
+select * from t1 partition (p1);
+x
+12
+select * from t1 partition (p2);
+x
+22
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Can only drop oldest partitions when rotating by INTERVAL
+alter table t1 convert partition p0 to table tp0;
+alter table t1 convert partition p1 to table tp1;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+show create table tp0;
+Table Create Table
+tp0 CREATE TABLE `tp0` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from tp0;
+x
+select * from tp1;
+x
+select * from tp0 for system_time all;
+x
+2
+select * from tp1 for system_time all;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR STARTS TIMESTAMP'2000-01-01 02:00:00'
+(PARTITION `p2` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+select * from t1;
+x
+3
+13
+23
+select * from t1 for system_time all order by x;
+x
+3
+13
+22
+23
+drop tables t1, tp0, tp1;
+# System-versioned tables (implicit)
+create or replace table t1(x int) with system versioning
+partition by system_time limit 1 partitions 3;
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME LIMIT 1
+(PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+drop tables t1, tp1;
+# Complex table
+create or replace table t1 (
+x int primary key auto_increment,
+t timestamp(6) default '2001-11-11 11:11:11',
+b blob(4096) compressed null,
+c varchar(1033) character set utf8 not null,
+u int,
+unique key (x, u),
+m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+i1 tinyint, i2 smallint, i3 bigint,
+index three(i1, i2, i3),
+v1 timestamp(6) generated always as (t + interval 1 day),
+v2 timestamp(6) generated always as (t + interval 1 month) stored,
+s timestamp(6) as row start,
+e timestamp(6) as row end,
+period for system_time (s, e),
+ps date, pe date,
+period for app_time (ps, pe),
+constraint check_constr check (u > -1))
+with system versioning default charset=ucs2
+partition by range(x) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition pn values less than maxvalue);
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) NOT NULL AUTO_INCREMENT,
+ `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+ `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+ `c` varchar(1033) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+ `u` int(11) DEFAULT NULL,
+ `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+ `i1` tinyint(4) DEFAULT NULL,
+ `i2` smallint(6) DEFAULT NULL,
+ `i3` bigint(20) DEFAULT NULL,
+ `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+ `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+ `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+ `ps` date NOT NULL,
+ `pe` date NOT NULL,
+ PERIOD FOR `app_time` (`ps`, `pe`),
+ PRIMARY KEY (`x`,`e`),
+ UNIQUE KEY `x` (`x`,`u`,`e`),
+ KEY `three` (`i1`,`i2`,`i3`),
+ PERIOD FOR SYSTEM_TIME (`s`, `e`),
+ CONSTRAINT `check_constr` CHECK (`u` > -1)
+) ENGINE=X DEFAULT CHARSET=ucs2 COLLATE=ucs2_general_ci WITH SYSTEM VERSIONING
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL AUTO_INCREMENT,
+ `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+ `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+ `c` varchar(1033) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+ `u` int(11) DEFAULT NULL,
+ `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+ `i1` tinyint(4) DEFAULT NULL,
+ `i2` smallint(6) DEFAULT NULL,
+ `i3` bigint(20) DEFAULT NULL,
+ `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+ `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+ `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+ `ps` date NOT NULL,
+ `pe` date NOT NULL,
+ PERIOD FOR `app_time` (`ps`, `pe`),
+ PRIMARY KEY (`x`,`e`),
+ UNIQUE KEY `x` (`x`,`u`,`e`),
+ KEY `three` (`i1`,`i2`,`i3`),
+ PERIOD FOR SYSTEM_TIME (`s`, `e`),
+ CONSTRAINT `check_constr` CHECK (`u` > -1)
+) ENGINE=X DEFAULT CHARSET=ucs2 COLLATE=ucs2_general_ci WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+drop tables t1, tp1;
+#
+# MDEV-29841 Partition by system_time can be converted into table but not back
+#
+create or replace table t (a int) with system versioning
+partition by system_time limit 10 partitions 3;
+alter table t convert partition p0 to table tp;
+alter table t convert table tp to partition p0;
+ERROR HY000: CONVERT TABLE TO PARTITION can only be used on RANGE/LIST partitions
+drop tables t, tp;
+#
+# End of 10.7 tests
+#
set global innodb_stats_persistent= @save_persistent;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 607aa8d603a..61653550389 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -611,7 +611,7 @@ create or replace table t1 (
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column b;
create or replace table t1 (
@@ -621,7 +621,7 @@ a int, b int primary key,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column b;
# cleanup
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
index 87cafdc7d32..6f5153b4ec1 100644
--- a/mysql-test/suite/versioning/t/create.test
+++ b/mysql-test/suite/versioning/t/create.test
@@ -412,11 +412,11 @@ drop tables t0, t1, t2, t3;
--echo #
--echo # MDEV-23968 CREATE TEMPORARY TABLE .. LIKE (system versioned table) returns error if unique index is defined in the table
--echo #
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int primary key, index(row_start)) with system versioning;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int primary key, index(row_end)) with system versioning;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int, primary key(id, row_end, row_end)) with system versioning;
create table t1 (id int primary key) with system versioning;
create temporary table t2 like t1;
diff --git a/mysql-test/suite/versioning/t/data.test b/mysql-test/suite/versioning/t/data.test
new file mode 100644
index 00000000000..ddae6633337
--- /dev/null
+++ b/mysql-test/suite/versioning/t/data.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source suite/versioning/common.inc
+
+--echo #
+--echo # MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables
+--echo #
+create or replace table t1 (x int) with system versioning;
+set timestamp=unix_timestamp('1990-01-01 00:00');
+insert t1 (x) values (1),(2),(3);
+set timestamp=unix_timestamp('1990-08-03 00:00');
+delete from t1 where x=1;
+set timestamp=unix_timestamp('1991-01-02 00:00');
+delete from t1 where x=2;
+set timestamp=default;
+
+--echo #MYSQL_DUMP --compact test
+--exec $MYSQL_DUMP --compact test
+--echo #MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+--exec $MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+--echo #MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+--exec $MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+## Forged query protection
+--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+--replace_result mariadb-dump.exe mariadb-dump
+--error 1
+--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+
+drop tables t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 535e791c8c8..29de10e4738 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -106,6 +106,18 @@ partition by system_time (
partition p0 history,
partition pn current);
+--error ER_PARTITION_WRONG_TYPE
+create or replace table t1 (a int)
+partition by range (a) (
+ partition p0 history,
+ partition p1 current);
+
+--error ER_PARTITION_WRONG_TYPE
+create or replace table t1 (b int)
+partition by range (a) (
+ partition p0 current,
+ partition p1 history);
+
--echo ## ALTER TABLE
@@ -232,7 +244,7 @@ partition by system_time limit 2 partitions 3;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
alter table t1 drop partition non_existent;
insert into t1 values (1), (2), (3), (4), (5), (6);
@@ -1533,6 +1545,7 @@ drop tables t1;
--echo #
--echo # MDEV-22155 ALTER add default history partitions name clash on non-default partitions
--echo #
+set timestamp= default;
create or replace table t1 (x int) with system versioning
partition by system_time limit 1
(partition p2 history, partition p8 history, partition pn current);
@@ -1552,6 +1565,219 @@ drop tables t1;
--echo # End of 10.5 tests
--echo #
+--echo #
+--echo # MDEV-22166 MIGRATE PARTITION: move out partition into a table
+--echo #
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+
+insert into t1 values (2), (12), (22), (32), (42), (52);
+update t1 set x= x + 1;
+
+alter table t1 convert partition p2 to table tp2;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+select * from tp2;
+select * from tp2 for system_time all order by x;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+select * from t1 for system_time all order by x;
+
+--echo # SP
+create or replace procedure sp()
+alter table t1 convert partition p3 to table tp3;
+call sp;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp3;
+select * from tp3;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp3;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+drop procedure sp;
+
+--echo # LOCK TABLES, PS, SP
+create or replace procedure sp()
+alter table t1 convert partition p4 to table tp4;
+lock tables t1 write;
+prepare stmt from 'call sp';
+execute stmt;
+
+# TODO: don't unlock here (see above TODO)
+unlock tables;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp4;
+select * from tp4;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp4;
+lock tables t1 write;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+drop prepare stmt;
+unlock tables;
+drop procedure sp;
+unlock tables;
+
+drop tables t1, tp2;
+
+--echo # System-versioned tables (SYSTEM_TIME LIMIT)
+
+create or replace table t1 (
+ x int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time limit 1 partitions 4;
+
+insert into t1 values (2), (12), (22);
+update t1 set x= x + 1 where x = 2;
+update t1 set x= x + 1 where x = 12;
+update t1 set x= x + 1 where x = 22;
+
+select * from t1 partition (p1);
+--error ER_VERS_WRONG_PARTS
+alter table t1 convert partition pn to table tp1;
+alter table t1 convert partition p1 to table tp1;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+select * from tp1;
+select * from tp1 for system_time all;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+select * from t1 for system_time all order by x;
+
+drop tables t1, tp1;
+
+--echo # System-versioned tables (SYSTEM_TIME INTERVAL)
+
+set timestamp= unix_timestamp('2000-01-01 00:00:00');
+create or replace table t1 (
+ x int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time interval 1 hour partitions 4;
+
+insert into t1 values (2), (12), (22);
+set timestamp= unix_timestamp('2000-01-01 00:00:01');
+update t1 set x= x + 1 where x = 2;
+set timestamp= unix_timestamp('2000-01-01 01:00:00');
+update t1 set x= x + 1 where x = 12;
+set timestamp= unix_timestamp('2000-01-01 02:00:00');
+update t1 set x= x + 1 where x = 22;
+
+select * from t1 partition (p0);
+select * from t1 partition (p1);
+select * from t1 partition (p2);
+--error ER_VERS_DROP_PARTITION_INTERVAL
+alter table t1 convert partition p1 to table tp1;
+alter table t1 convert partition p0 to table tp0;
+alter table t1 convert partition p1 to table tp1;
+--error ER_VERS_WRONG_PARTS
+alter table t1 convert partition p2 to table tp2;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp0;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+select * from tp0;
+select * from tp1;
+select * from tp0 for system_time all;
+select * from tp1 for system_time all;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1;
+select * from t1 for system_time all order by x;
+
+drop tables t1, tp0, tp1;
+
+--echo # System-versioned tables (implicit)
+
+create or replace table t1(x int) with system versioning
+partition by system_time limit 1 partitions 3;
+
+alter table t1 convert partition p1 to table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+drop tables t1, tp1;
+
+if (!$MTR_COMBINATION_HEAP)
+{
+--echo # Complex table
+create or replace table t1 (
+ x int primary key auto_increment,
+ t timestamp(6) default '2001-11-11 11:11:11',
+ b blob(4096) compressed null,
+ c varchar(1033) character set utf8 not null,
+ u int,
+ unique key (x, u),
+ m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+ i1 tinyint, i2 smallint, i3 bigint,
+ index three(i1, i2, i3),
+ v1 timestamp(6) generated always as (t + interval 1 day),
+ v2 timestamp(6) generated always as (t + interval 1 month) stored,
+ s timestamp(6) as row start,
+ e timestamp(6) as row end,
+ period for system_time (s, e),
+ ps date, pe date,
+ period for app_time (ps, pe),
+ constraint check_constr check (u > -1))
+with system versioning default charset=ucs2
+partition by range(x) (
+ partition p0 values less than (10),
+ partition p1 values less than (20),
+ partition pn values less than maxvalue);
+
+alter table t1 convert partition p1 to table tp1;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+drop tables t1, tp1;
+}
+
+--echo #
+--echo # MDEV-29841 Partition by system_time can be converted into table but not back
+--echo #
+create or replace table t (a int) with system versioning
+partition by system_time limit 10 partitions 3;
+alter table t convert partition p0 to table tp;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t convert table tp to partition p0;
+drop tables t, tp;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
+
set global innodb_stats_persistent= @save_persistent;
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 82c480917f1..8e1af35fd62 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -105,8 +105,6 @@ WSREP_FORCED_BINLOG_FORMAT
WSREP_GTID_DOMAIN_ID
WSREP_GTID_MODE
WSREP_GTID_SEQ_NO
-WSREP_MODE
-WSREP_STRICT_DDL
WSREP_IGNORE_APPLY_ERRORS
WSREP_LOAD_DATA_SPLITTING
WSREP_LOG_CONFLICTS
@@ -125,7 +123,6 @@ WSREP_PROVIDER
WSREP_PROVIDER_OPTIONS
WSREP_RECOVER
WSREP_REJECT_QUERIES
-WSREP_REPLICATE_MYISAM
WSREP_RESTART_SLAVE
WSREP_RETRY_AUTOCOMMIT
WSREP_SLAVE_FK_CHECKS
@@ -138,7 +135,6 @@ WSREP_SST_DONOR_REJECTS_QUERIES
WSREP_SST_METHOD
WSREP_SST_RECEIVE_ADDRESS
WSREP_START_POSITION
-WSREP_STRICT_DDL
WSREP_SYNC_WAIT
WSREP_TRX_FRAGMENT_SIZE
WSREP_TRX_FRAGMENT_UNIT
diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result
index fe2bffb3f08..0690f540a37 100644
--- a/mysql-test/suite/wsrep/r/variables_debug.result
+++ b/mysql-test/suite/wsrep/r/variables_debug.result
@@ -105,11 +105,13 @@ WSREP_DRUPAL_282555_WORKAROUND
WSREP_FORCED_BINLOG_FORMAT
WSREP_GTID_DOMAIN_ID
WSREP_GTID_MODE
+WSREP_GTID_SEQ_NO
WSREP_IGNORE_APPLY_ERRORS
WSREP_LOAD_DATA_SPLITTING
WSREP_LOG_CONFLICTS
WSREP_MAX_WS_ROWS
WSREP_MAX_WS_SIZE
+WSREP_MODE
WSREP_MYSQL_REPLICATION_BUNDLE
WSREP_NODE_ADDRESS
WSREP_NODE_INCOMING_ADDRESS
@@ -122,7 +124,6 @@ WSREP_PROVIDER
WSREP_PROVIDER_OPTIONS
WSREP_RECOVER
WSREP_REJECT_QUERIES
-WSREP_REPLICATE_MYISAM
WSREP_RESTART_SLAVE
WSREP_RETRY_AUTOCOMMIT
WSREP_SLAVE_FK_CHECKS